link-stack/packages/leafcutter-common/components/Welcome.tsx

59 lines
1.4 KiB
TypeScript
Raw Normal View History

2023-06-26 10:07:12 +00:00
"use client";
2023-02-13 13:46:56 +00:00
import { Box, Grid } from "@mui/material";
import { useSession } from "next-auth/react";
import { useTranslate } from "react-polyglot";
2023-08-25 07:11:33 +00:00
import { useAppContext } from "../../../apps/leafcutter/app/_components/AppProvider";
2023-02-13 13:46:56 +00:00
export const Welcome = () => {
const t = useTranslate();
const { data: session } = useSession();
2023-06-28 09:09:45 +00:00
/*
2023-02-13 13:46:56 +00:00
const {
user: { name },
2023-05-24 20:27:57 +00:00
} = session as any;
2023-06-28 09:09:45 +00:00
*/
2023-08-25 07:11:33 +00:00
const name = "Test User";
2023-02-13 13:46:56 +00:00
const {
colors: { white, leafcutterElectricBlue },
typography: { h1, h4, p },
} = useAppContext();
return (
<Box
sx={{
width: "100%",
backgroundColor: leafcutterElectricBlue,
color: white,
p: 4,
borderRadius: "10px",
mb: "22px",
}}
>
<Grid container direction="row" spacing={3}>
{/* <Grid
item
container
xs={3}
direction="column"
justifyContent="flex-start"
alignItems="center"
>
<img src={image} alt={name} width="150px" />
</Grid> */}
<Grid item xs={12}>
<Box component="h1" sx={{ ...h1, mb: 1 }}>
{t("dashboardTitle")}
</Box>
2023-08-25 07:11:33 +00:00
<Box component="h4" sx={{ ...h4, mt: 1, mb: 1 }}>{`${t(
"welcome",
)}, ${name?.split(" ")[0]}! 👋`}</Box>
2023-02-13 13:46:56 +00:00
<Box component="p" sx={{ ...p }}>
{t("dashboardDescription")}
</Box>
</Grid>
</Grid>
</Box>
);
};