import React, { useEffect, useState } from "react"; import { useRouter } from "next/router"; import Image from "next/image"; import Link from "next/link"; import useSWR, { mutate } from "swr"; // next-themes import { useTheme } from "next-themes"; // layouts import { WorkspaceAuthorizationLayout } from "layouts/auth-layout"; // services import userService from "services/user.service"; // hooks import useUser from "hooks/use-user"; import useProjects from "hooks/use-projects"; // components import { CompletedIssuesGraph, IssuesList, IssuesPieChart, IssuesStats, } from "components/workspace"; import { TourRoot } from "components/onboarding"; // ui import { PrimaryButton, ProductUpdatesModal } from "components/ui"; // icons import { BoltOutlined, GridViewOutlined } from "@mui/icons-material"; // images import emptyDashboard from "public/empty-state/dashboard.svg"; import githubBlackImage from "/public/logos/github-black.png"; import githubWhiteImage from "/public/logos/github-white.png"; // types import { ICurrentUserResponse } from "types"; import type { NextPage } from "next"; // fetch-keys import { CURRENT_USER, USER_WORKSPACE_DASHBOARD } from "constants/fetch-keys"; const Greeting = ({ user }: { user: ICurrentUserResponse | undefined }) => { const currentTime = new Date(); const hour = new Intl.DateTimeFormat("en-US", { hour12: false, hour: "numeric", }).format(currentTime); const date = new Intl.DateTimeFormat("en-US", { month: "short", day: "numeric", }).format(currentTime); const weekDay = new Intl.DateTimeFormat("en-US", { weekday: "long", }).format(currentTime); const timeString = new Intl.DateTimeFormat("en-US", { timeZone: user?.user_timezone, hour12: false, // Use 24-hour format hour: "2-digit", minute: "2-digit", }).format(currentTime); const greeting = parseInt(hour, 10) < 12 ? "morning" : parseInt(hour, 10) < 18 ? "afternoon" : "evening"; return (
Manage your projects by creating issues, cycles, modules, views and pages.