mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 07:45:47 +00:00
refactor(FE): Remove Kandang prop and center Uniformity gauge
This commit is contained in:
@@ -72,7 +72,6 @@ const UniformityChart = () => {
|
|||||||
// const gaugeChartData: GaugeChartData = {
|
// const gaugeChartData: GaugeChartData = {
|
||||||
// value: 0,
|
// value: 0,
|
||||||
// label: '',
|
// label: '',
|
||||||
// kandang: 'Kandang Cirangga',
|
|
||||||
// week: 'Week 2',
|
// week: 'Week 2',
|
||||||
// currentValue: 512,
|
// currentValue: 512,
|
||||||
// totalValue: 1024,
|
// totalValue: 1024,
|
||||||
@@ -81,7 +80,6 @@ const UniformityChart = () => {
|
|||||||
const gaugeChartData: GaugeChartData = {
|
const gaugeChartData: GaugeChartData = {
|
||||||
value: 52,
|
value: 52,
|
||||||
label: 'Uniformity',
|
label: 'Uniformity',
|
||||||
kandang: 'Kandang Cirangga',
|
|
||||||
week: 'Week 2',
|
week: 'Week 2',
|
||||||
currentValue: 512,
|
currentValue: 512,
|
||||||
totalValue: 1024,
|
totalValue: 1024,
|
||||||
@@ -128,7 +126,6 @@ const UniformityChart = () => {
|
|||||||
<UniformityGaugeChart
|
<UniformityGaugeChart
|
||||||
value={gaugeChartData.value}
|
value={gaugeChartData.value}
|
||||||
label={gaugeChartData.label}
|
label={gaugeChartData.label}
|
||||||
kandang={gaugeChartData.kandang}
|
|
||||||
week={gaugeChartData.week}
|
week={gaugeChartData.week}
|
||||||
currentValue={gaugeChartData.currentValue}
|
currentValue={gaugeChartData.currentValue}
|
||||||
totalValue={gaugeChartData.totalValue}
|
totalValue={gaugeChartData.totalValue}
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Cell, Pie, PieChart, ResponsiveContainer } from 'recharts';
|
import { Cell, Pie, PieChart, ResponsiveContainer } from 'recharts';
|
||||||
import Card from '@/components/Card';
|
import Card from '@/components/Card';
|
||||||
import { Icon } from '@iconify/react';
|
|
||||||
import { formatNumber } from '@/lib/helper';
|
import { formatNumber } from '@/lib/helper';
|
||||||
|
|
||||||
interface UniformityGaugeChartProps {
|
interface UniformityGaugeChartProps {
|
||||||
value: number;
|
value: number;
|
||||||
label: string;
|
label: string;
|
||||||
kandang?: string;
|
|
||||||
week?: string;
|
week?: string;
|
||||||
currentValue?: number;
|
currentValue?: number;
|
||||||
totalValue?: number;
|
totalValue?: number;
|
||||||
@@ -16,7 +14,6 @@ interface UniformityGaugeChartProps {
|
|||||||
const UniformityGaugeChart: React.FC<UniformityGaugeChartProps> = ({
|
const UniformityGaugeChart: React.FC<UniformityGaugeChartProps> = ({
|
||||||
value,
|
value,
|
||||||
label,
|
label,
|
||||||
kandang,
|
|
||||||
week,
|
week,
|
||||||
currentValue,
|
currentValue,
|
||||||
totalValue,
|
totalValue,
|
||||||
@@ -34,7 +31,7 @@ const UniformityGaugeChart: React.FC<UniformityGaugeChartProps> = ({
|
|||||||
const inactiveColor = '#f0f0f0';
|
const inactiveColor = '#f0f0f0';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='flex flex-col w-full'>
|
<div className='flex flex-col w-full items-center'>
|
||||||
<div className='h-64 w-full relative flex justify-center'>
|
<div className='h-64 w-full relative flex justify-center'>
|
||||||
<div className='relative w-full h-full flex flex-col items-center justify-end'>
|
<div className='relative w-full h-full flex flex-col items-center justify-end'>
|
||||||
<ResponsiveContainer width='100%' height='100%'>
|
<ResponsiveContainer width='100%' height='100%'>
|
||||||
@@ -76,18 +73,13 @@ const UniformityGaugeChart: React.FC<UniformityGaugeChartProps> = ({
|
|||||||
<Card
|
<Card
|
||||||
variant='bordered'
|
variant='bordered'
|
||||||
className={{
|
className={{
|
||||||
wrapper: 'w-full',
|
wrapper: 'max-w-max mx-auto',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<section className='flex items-center gap-4'>
|
<section className='flex items-center justify-center gap-4'>
|
||||||
<div className='w-12 h-12 bg-base-200 rounded-lg flex items-center justify-center border border-gray-200 shrink-0'>
|
<div className='grid grid-cols-1 min-w-0 text-center'>
|
||||||
<Icon icon='heroicons:calendar-date-range' width={24} height={24} />
|
<div className='flex items-center justify-center space-x-2 text-[#18181B80] text-sm mb-1'>
|
||||||
</div>
|
<span className='text-[#0069E0] font-semibold truncate text-center flex justify-center'>
|
||||||
<div className='grid grid-cols-1 min-w-0'>
|
|
||||||
<div className='flex items-center space-x-2 text-[#18181B80] text-sm mb-1'>
|
|
||||||
<span className='font-medium truncate'>{kandang}</span>
|
|
||||||
<span className='shrink-0'>•</span>
|
|
||||||
<span className='text-[#0069E0] font-semibold truncate'>
|
|
||||||
{week}
|
{week}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+1
-1
@@ -28,7 +28,7 @@ const UniformityGaugeChartSkeleton: React.FC<
|
|||||||
const inactiveColor = '#f0f0f0';
|
const inactiveColor = '#f0f0f0';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='flex flex-col w-full'>
|
<div className='flex flex-col w-full items-center'>
|
||||||
<div className='h-64 w-full relative flex justify-center min-h-[256px]'>
|
<div className='h-64 w-full relative flex justify-center min-h-[256px]'>
|
||||||
<div className='relative w-full h-full flex flex-col items-center justify-end min-w-0'>
|
<div className='relative w-full h-full flex flex-col items-center justify-end min-w-0'>
|
||||||
<ResponsiveContainer width='100%' height={256}>
|
<ResponsiveContainer width='100%' height={256}>
|
||||||
|
|||||||
Reference in New Issue
Block a user