add task empty state back as it's being used by multiple pages

This commit is contained in:
rsandb
2023-01-17 21:18:46 -06:00
parent 0c1bb8df05
commit bc1fdbe89f
2 changed files with 8 additions and 4 deletions
+6 -1
View File
@@ -1,5 +1,6 @@
import { Box, Link, Text, useColorModeValue } from "@chakra-ui/react";
import { useRouter } from "next/router";
import { FiAlertTriangle } from "react-icons/fi";
import { IconType } from "react-icons/lib";
type EmptyStateProps = {
@@ -12,7 +13,7 @@ export const EmptyState = (props: EmptyStateProps) => {
const router = useRouter();
return (
<Box bg={backgroundColor} p="10" borderRadius="xl" shadow="base" maxWidth="3xl">
<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>
@@ -23,3 +24,7 @@ export const EmptyState = (props: EmptyStateProps) => {
</Box>
);
};
export const TaskEmptyState = () => {
return <EmptyState text="Looks like no tasks were found." icon={FiAlertTriangle} />;
};
+2 -3
View File
@@ -1,6 +1,5 @@
import Head from "next/head";
import { FiAlertTriangle } from "react-icons/fi";
import { EmptyState } from "src/components/EmptyState";
import { TaskEmptyState } from "src/components/EmptyState";
import { getDashboardLayout } from "src/components/Layout";
import { LoadingScreen } from "src/components/Loading/LoadingScreen";
import { Task } from "src/components/Tasks/Task";
@@ -14,7 +13,7 @@ const RandomTask = () => {
}
if (tasks.length === 0) {
return <EmptyState text="Looks like no tasks were found." icon={FiAlertTriangle} />;
return <TaskEmptyState />;
}
return (