mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
32 lines
657 B
TypeScript
32 lines
657 B
TypeScript
|
// hooks
|
||
|
import useUser from "hooks/use-user";
|
||
|
// ui
|
||
|
import { Loader } from "components/ui";
|
||
|
|
||
|
export const WorkspaceHomeGreetings = () => {
|
||
|
// user information
|
||
|
const { user } = useUser();
|
||
|
|
||
|
const hours = new Date().getHours();
|
||
|
|
||
|
return (
|
||
|
<>
|
||
|
{user ? (
|
||
|
<div className="text-2xl font-medium">
|
||
|
Good{" "}
|
||
|
{hours >= 4 && hours < 12
|
||
|
? "Morning"
|
||
|
: hours >= 12 && hours < 17
|
||
|
? "Afternoon"
|
||
|
: "Evening"}
|
||
|
, {user.first_name}!
|
||
|
</div>
|
||
|
) : (
|
||
|
<Loader>
|
||
|
<Loader.Item height="2rem" width="20rem" />
|
||
|
</Loader>
|
||
|
)}
|
||
|
</>
|
||
|
);
|
||
|
};
|