-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBoardPreview.tsx
49 lines (45 loc) · 1.3 KB
/
BoardPreview.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
"use client";
import { type BOARD_COLUMNS, type BoardColumns } from "@/models/BoardModel";
import { Flex, Text, Title } from "@mantine/core";
import { IconMoodSadDizzy } from "@tabler/icons-react";
import { Fragment, type FC } from "react";
import BoardColumn from "../BoardColumn/BoardColumn";
import classes from "./BoardPreview.module.css";
interface Props {
isReady: boolean;
board: BoardColumns;
}
const BoardPreview: FC<Props> = (props) => {
const { isReady, board } = props;
return (
<Fragment>
{isReady ? (
<Flex className={classes.container} gap="xl">
{Object.keys(board).map((col) => {
const key = col as BOARD_COLUMNS;
const items = board[key];
return (
<BoardColumn
key={col}
column={key}
items={items}
interactive={false}
/>
);
})}
</Flex>
) : (
<Flex className={classes.private}>
<IconMoodSadDizzy size={120} />
<Title mt="xs" order={3}>
Board not exist!
</Title>
<Text mt="xs" c="dimmed">
Or the user is restricted from accessing their board.
</Text>
</Flex>
)}
</Fragment>
);
};
export default BoardPreview;