|
1 | 1 | import { useTranslation } from "next-i18next"
|
2 | 2 | import { useTheme } from "next-themes"
|
3 |
| -import { Box, type BoxProps, Flex } from "@chakra-ui/react" |
4 | 3 |
|
5 | 4 | import type { ChildOnlyProp } from "@/lib/types"
|
6 | 5 |
|
| 6 | +import { cn } from "@/lib/utils/cn" |
| 7 | + |
| 8 | +import { Flex } from "./ui/flex" |
| 9 | + |
| 10 | +type CellProps = ChildOnlyProp & { |
| 11 | + color?: string |
| 12 | + className?: string |
| 13 | +} |
| 14 | + |
7 | 15 | const Column = ({ children }: ChildOnlyProp) => (
|
8 |
| - <Flex |
9 |
| - flexDirection="column-reverse" |
10 |
| - ms={{ base: 2, md: 4 }} |
11 |
| - _first={{ ms: 0 }} |
12 |
| - > |
13 |
| - {children} |
14 |
| - </Flex> |
| 16 | + <Flex className="ms-2 flex-col-reverse first:ms-0 md:ms-4">{children}</Flex> |
15 | 17 | )
|
16 | 18 |
|
17 |
| -const Cell = ({ children, color, ...props }: BoxProps) => ( |
18 |
| - <Box |
19 |
| - border="1px solid" |
20 |
| - borderColor={color || "text"} |
21 |
| - color={color || "text"} |
22 |
| - py="0.8rem" |
23 |
| - px={{ base: 2, md: "1.2rem" }} |
24 |
| - fontSize="0.9rem" |
25 |
| - fontWeight="bold" |
26 |
| - lineHeight="none" |
27 |
| - textAlign="center" |
28 |
| - _last={{ |
29 |
| - borderTopStartRadius: "2xl", |
30 |
| - borderTopEndRadius: "2xl", |
31 |
| - }} |
32 |
| - sx={{ |
33 |
| - "&:nth-child(-n + 2)": { |
34 |
| - borderBottomStartRadius: "2xl", |
35 |
| - borderBottomEndRadius: "2xl", |
36 |
| - }, |
| 19 | +const Cell = ({ children, color, className, ...props }: CellProps) => ( |
| 20 | + <div |
| 21 | + className={cn( |
| 22 | + "border border-solid px-2 py-[0.8rem] text-center text-[0.9rem] font-bold leading-none last:rounded-t-2xl md:px-[1.2rem] [&:nth-child(-n+2)]:rounded-bl-2xl [&:nth-child(-n+2)]:rounded-br-2xl", |
| 23 | + className |
| 24 | + )} |
| 25 | + style={{ |
| 26 | + borderColor: color || "currentcolor", |
| 27 | + color: color || "currentcolor", |
37 | 28 | }}
|
38 | 29 | {...props}
|
39 | 30 | >
|
40 | 31 | {children}
|
41 |
| - </Box> |
| 32 | + </div> |
42 | 33 | )
|
43 | 34 |
|
44 | 35 | const ColumnName = ({ children }: ChildOnlyProp) => (
|
45 |
| - <Cell border="none" pt={6}> |
46 |
| - {children} |
47 |
| - </Cell> |
| 36 | + <Cell className={"border-none pt-6"}>{children}</Cell> |
48 | 37 | )
|
49 | 38 |
|
50 | 39 | const AdoptionChart = () => {
|
|
0 commit comments