From a231140bc07ae081773f1887ef57923fd4c97bb6 Mon Sep 17 00:00:00 2001 From: rstubryan Date: Thu, 19 Feb 2026 12:02:04 +0700 Subject: [PATCH] refactor(FE): Refactor ProductionDataClosingTab to use Card component --- .../closing/tab/ProductionDataClosingTab.tsx | 446 +++++++++--------- .../pages/closing/table/SalesClosingTable.tsx | 6 +- 2 files changed, 231 insertions(+), 221 deletions(-) diff --git a/src/components/pages/closing/tab/ProductionDataClosingTab.tsx b/src/components/pages/closing/tab/ProductionDataClosingTab.tsx index 3647dc1f..ae61be3b 100644 --- a/src/components/pages/closing/tab/ProductionDataClosingTab.tsx +++ b/src/components/pages/closing/tab/ProductionDataClosingTab.tsx @@ -6,6 +6,7 @@ import { ClosingApi } from '@/services/api/closing'; import { isResponseSuccess } from '@/lib/api-helper'; import { formatNumber } from '@/lib/helper'; import ProductionDataClosingSkeleton from '@/components/pages/closing/skeleton/ProductionDataClosingSkeleton'; +import Card from '@/components/Card'; interface ProductionDataClosingTabProps { projectFlockId: number; @@ -62,244 +63,257 @@ const ProductionDataClosingTab = ({ ); return ( -
-

Data Produksi

+
+ +
+
+ {/* Left Column */} +
+ {/* Purchase Section */} +
+

+ Pembelian +

+
+ + + + + +
+
-
- {/* Left Column */} -
- {/* Purchase Section */} -
-

- Pembelian -

-
- - - - - -
-
- - {/* Sales Section */} -
-

- Penjualan -

-
- {/* Chicken Sales */} -
- - - - -
- - {/* Egg Sales (if available) */} - {sales.egg && ( - <> -
+ {/* Sales Section */} +
+

+ Penjualan +

+
+ {/* Chicken Sales */}
- - )} + + {/* Egg Sales (if available) */} + {sales.egg && ( + <> +
+
+ + + + +
+ + )} +
+
-
-
- {/* Divider Line (Absolute centered) */} -
+ {/* Divider Line (Absolute centered) */} +
- {/* Right Column */} -
- {/* Performance Section */} -
-

- Performance -

-
- - - - - - {/* - */} - - - - - + {/* Right Column */} +
+ {/* Performance Section */} +
+

+ Performance +

+
+ + + + + + {/* + */} + + + + + - {/* Laying Specific Fields */} - {performance.hen_day_act !== undefined && ( - <> - - - - )} + {/* Laying Specific Fields */} + {performance.hen_day_act !== undefined && ( + <> + + + + )} - {performance.egg_mass !== undefined && ( - <> - - - - )} + {performance.egg_mass !== undefined && ( + <> + + + + )} - {performance.egg_weight !== undefined && ( - <> - - - - )} + {performance.egg_weight !== undefined && ( + <> + + + + )} - {performance.hen_housed_act !== undefined && ( - <> - - - - )} + {performance.hen_housed_act !== undefined && ( + <> + + + + )} +
+
-
+
-
+
); }; diff --git a/src/components/pages/closing/table/SalesClosingTable.tsx b/src/components/pages/closing/table/SalesClosingTable.tsx index 0ebd5f2f..5105d965 100644 --- a/src/components/pages/closing/table/SalesClosingTable.tsx +++ b/src/components/pages/closing/table/SalesClosingTable.tsx @@ -6,11 +6,7 @@ import Table from '@/components/Table'; import Card from '@/components/Card'; import { formatCurrency, formatNumber, formatDate } from '@/lib/helper'; import { isResponseSuccess } from '@/lib/api-helper'; -import { - BaseClosingSales, - BaseSales, - ClosingSalesSummary, -} from '@/types/api/closing'; +import { BaseSales, ClosingSalesSummary } from '@/types/api/closing'; import { Product } from '@/types/api/master-data/product'; import { Customer } from '@/types/api/master-data/customer'; import { Kandang } from '@/types/api/master-data/kandang';