Skip to content

Commit cf72be4

Browse files
migration stat component to shadcn/tailwind [Fixes #13946]
1 parent cd1e25f commit cf72be4

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

src/components/Stat/index.tsx

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { useEffect, useState } from "react"
2-
import type { IconType } from "react-icons/lib"
32
import { MdInfoOutline, MdWarning } from "react-icons/md"
4-
import { chakra, Flex, HStack, Icon, Text } from "@chakra-ui/react"
5-
3+
import type { IconType } from "react-icons/lib"
64
import { NULL_VALUE } from "@/lib/constants"
7-
5+
import { Flex } from "@/components/ui/flex"
86
import Tooltip, { type TooltipProps } from "../Tooltip"
97

8+
109
const initialContent = {
1110
contentValue: NULL_VALUE,
1211
tooltipIcon: MdInfoOutline,
@@ -39,20 +38,18 @@ const Stat = ({ tooltipProps, value, label, isError }: StatProps) => {
3938
}, [isError, value])
4039

4140
return (
42-
<Flex flexDirection="column-reverse">
43-
<HStack lineHeight="initial" spacing="0.5" color="body.medium">
44-
<Text as="span">{label}</Text>
41+
<Flex className="flex-col-reverse">
42+
<div className="flex items-center space-x-2 leading-none text-body-medium">
43+
<span>{label}</span>
4544
{!!tooltipProps && (
4645
<Tooltip {...tooltipProps}>
47-
<chakra.button display="flex" color="inherit">
48-
<Icon as={content.tooltipIcon} />
49-
</chakra.button>
46+
<button className="flex text-inherit">
47+
<content.tooltipIcon className="h-4 w-4" />
48+
</button>
5049
</Tooltip>
5150
)}
52-
</HStack>
53-
<Text as="span" size="5xl" fontWeight="bold">
54-
{content.contentValue}
55-
</Text>
51+
</div>
52+
<span className="text-5xl font-bold">{content.contentValue}</span>
5653
</Flex>
5754
)
5855
}

0 commit comments

Comments
 (0)