diff --git a/src/components/pages/uniformity/form/UniformityResultForm.tsx b/src/components/pages/uniformity/form/UniformityResultForm.tsx index 7b8466fb..09be7fdd 100644 --- a/src/components/pages/uniformity/form/UniformityResultForm.tsx +++ b/src/components/pages/uniformity/form/UniformityResultForm.tsx @@ -15,6 +15,7 @@ import toast from 'react-hot-toast'; import { UniformityApi } from '@/services/api/uniformity'; import { isResponseError } from '@/lib/api-helper'; import Badge from '@/components/Badge'; +import { formatNumber } from '@/lib/helper'; const weightStatusColorMap: Record = { ideal: 'bg-[#00D39033]', @@ -126,26 +127,28 @@ const UniformityResultForm = () => { const samplingTableData: SamplingData[] = useMemo(() => { if (!verifyUniformityResult) return []; + const { sampling } = verifyUniformityResult; + return [ { id: 'sampling-size', label: 'Sampling size', - value: `1,150 of Birds`, + value: `${formatNumber(sampling.chick_qty_of_weight)} of Birds`, }, { id: 'mean-weight', label: 'Mean Weight', - value: `121 g`, + value: `${sampling.mean_weight} g`, }, { id: 'min-limit', label: 'Min Limit (-10%)', - value: `109 g`, + value: `${sampling.mean_down} g`, }, { id: 'max-limit', label: 'Max Limit (+10%)', - value: `133 g`, + value: `${sampling.mean_up} g`, }, ]; }, [verifyUniformityResult]); @@ -169,21 +172,23 @@ const UniformityResultForm = () => { const resultTableData: ResultData[] = useMemo(() => { if (!verifyUniformityResult) return []; + const { result } = verifyUniformityResult; + return [ { id: 'ideal-birds', label: 'Ideal Birds', - value: `851 of Birds`, + value: `${formatNumber(result.uniform_qty)} of Birds`, }, { id: 'outside-range', label: 'Outside Range', - value: `299 of Birds`, + value: `${formatNumber(result.outside_qty)} of Birds`, }, { id: 'uniformity', label: 'Uniformity', - value: `74 %`, + value: `${result.uniformity} %`, }, ]; }, [verifyUniformityResult]); @@ -250,11 +255,12 @@ const UniformityResultForm = () => { statusIndicator={true} variant='soft' className={{ - badge: `rounded-xl w-full justify-start border border-gray-200 text-black bg-[#00D39033]`, - status: 'bg-[#008000]', + badge: + 'rounded-xl w-full justify-start border border-gray-200 text-black bg-info/10', + status: 'bg-info', }} > - Ideal + Unknown ); },