Redirect users to dashboard if there are no tasks

This commit is contained in:
AbdBarho
2023-01-22 12:15:21 +01:00
parent fd703663bd
commit fb4e94487c
+5 -6
View File
@@ -1,5 +1,5 @@
import { Box, Link, Text, useColorModeValue } from "@chakra-ui/react";
import { useRouter } from "next/router";
import { Box, Text, useColorModeValue } from "@chakra-ui/react";
import NextLink from "next/link";
import { FiAlertTriangle } from "react-icons/fi";
import { IconType } from "react-icons/lib";
@@ -10,16 +10,15 @@ type EmptyStateProps = {
export const EmptyState = (props: EmptyStateProps) => {
const backgroundColor = useColorModeValue("white", "gray.800");
const router = useRouter();
return (
<Box bg={backgroundColor} p="10" borderRadius="xl" shadow="base">
<Box display="flex" flexDirection="column" alignItems="center" gap="8" fontSize="lg">
<props.icon size="30" color="DarkOrange" />
<Text>{props.text}</Text>
<Link onClick={() => router.back()} color="blue.500" textUnderlineOffset="3px">
<Text>Click here to go back</Text>
</Link>
<NextLink href="/dashboard">
<Text color="blue.500">Go back to the dashboard</Text>
</NextLink>
</Box>
</Box>
);