Skip to content

Commit d042f4a

Browse files
authored
Merge pull request #14321 from bhushanpardeshii/migrate_stat
Migrated stat component to shadcn/tailwind
2 parents 0990e83 + a64a41c commit d042f4a

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/components/Stat/index.tsx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { useEffect, useState } from "react"
22
import type { IconType } from "react-icons/lib"
33
import { MdInfoOutline, MdWarning } from "react-icons/md"
4-
import { chakra, Flex, HStack, Icon, Text } from "@chakra-ui/react"
4+
5+
import { Flex } from "@/components/ui/flex"
56

67
import { NULL_VALUE } from "@/lib/constants"
78

@@ -39,22 +40,20 @@ const Stat = ({ tooltipProps, value, label, isError }: StatProps) => {
3940
}, [isError, value])
4041

4142
return (
42-
<Flex flexDirection="column-reverse">
43-
<HStack lineHeight="initial" spacing="0.5" color="body.medium">
44-
<Text as="span">{label}</Text>
43+
<Flex className="flex-col-reverse">
44+
<div className="flex items-center space-x-2 leading-none text-body-medium">
45+
<span>{label}</span>
4546
{!!tooltipProps && (
4647
<Tooltip {...tooltipProps}>
47-
<chakra.button display="flex" color="inherit">
48-
<Icon as={content.tooltipIcon} />
49-
</chakra.button>
48+
<button className="flex text-inherit">
49+
<content.tooltipIcon className="h-4 w-4" />
50+
</button>
5051
</Tooltip>
5152
)}
52-
</HStack>
53-
<Text as="span" size="5xl" fontWeight="bold">
54-
{content.contentValue}
55-
</Text>
53+
</div>
54+
<span className="text-5xl font-bold">{content.contentValue}</span>
5655
</Flex>
5756
)
5857
}
5958

60-
export default Stat
59+
export default Stat

0 commit comments

Comments
 (0)