From cf72be451cf69867654c446e6eff2cf7c0dc915a Mon Sep 17 00:00:00 2001 From: bhushanpardeshii Date: Wed, 6 Nov 2024 15:21:17 +0530 Subject: [PATCH 1/3] migration stat component to shadcn/tailwind [Fixes #13946] --- src/components/Stat/index.tsx | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/components/Stat/index.tsx b/src/components/Stat/index.tsx index a7beeb38982..459b915f1c0 100644 --- a/src/components/Stat/index.tsx +++ b/src/components/Stat/index.tsx @@ -1,12 +1,11 @@ import { useEffect, useState } from "react" -import type { IconType } from "react-icons/lib" import { MdInfoOutline, MdWarning } from "react-icons/md" -import { chakra, Flex, HStack, Icon, Text } from "@chakra-ui/react" - +import type { IconType } from "react-icons/lib" import { NULL_VALUE } from "@/lib/constants" - +import { Flex } from "@/components/ui/flex" import Tooltip, { type TooltipProps } from "../Tooltip" + const initialContent = { contentValue: NULL_VALUE, tooltipIcon: MdInfoOutline, @@ -39,20 +38,18 @@ const Stat = ({ tooltipProps, value, label, isError }: StatProps) => { }, [isError, value]) return ( - - - {label} + +
+ {label} {!!tooltipProps && ( - - - + )} - - - {content.contentValue} - +
+ {content.contentValue}
) } From 251a0070c0b920630c4b48a797033b14f587c3c6 Mon Sep 17 00:00:00 2001 From: bhushanpardeshii Date: Wed, 6 Nov 2024 15:40:03 +0530 Subject: [PATCH 2/3] migration stat component to shadcn/tailwind [Fixes #13946] --- src/components/Stat/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/Stat/index.tsx b/src/components/Stat/index.tsx index 459b915f1c0..38abfa9b118 100644 --- a/src/components/Stat/index.tsx +++ b/src/components/Stat/index.tsx @@ -5,7 +5,6 @@ import { NULL_VALUE } from "@/lib/constants" import { Flex } from "@/components/ui/flex" import Tooltip, { type TooltipProps } from "../Tooltip" - const initialContent = { contentValue: NULL_VALUE, tooltipIcon: MdInfoOutline, From a64a41c18fc4b45f33903554189f0952230a52f8 Mon Sep 17 00:00:00 2001 From: Bhushan Pardeshi Date: Wed, 6 Nov 2024 16:24:56 +0530 Subject: [PATCH 3/3] formated --- src/components/Stat/index.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/Stat/index.tsx b/src/components/Stat/index.tsx index 38abfa9b118..c652ba70745 100644 --- a/src/components/Stat/index.tsx +++ b/src/components/Stat/index.tsx @@ -1,8 +1,11 @@ import { useEffect, useState } from "react" -import { MdInfoOutline, MdWarning } from "react-icons/md" import type { IconType } from "react-icons/lib" -import { NULL_VALUE } from "@/lib/constants" +import { MdInfoOutline, MdWarning } from "react-icons/md" + import { Flex } from "@/components/ui/flex" + +import { NULL_VALUE } from "@/lib/constants" + import Tooltip, { type TooltipProps } from "../Tooltip" const initialContent = { @@ -53,4 +56,4 @@ const Stat = ({ tooltipProps, value, label, isError }: StatProps) => { ) } -export default Stat +export default Stat \ No newline at end of file