From 4081a326e35d1dd9e14d4406a53727407e2a0111 Mon Sep 17 00:00:00 2001 From: ValdiANS Date: Wed, 21 Jan 2026 12:38:30 +0700 Subject: [PATCH] feat: add edit button --- .../ListDailyChecklistContent.tsx | 46 +++++++++++++++---- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/src/figma-make/components/pages/list-daily-checklist/ListDailyChecklistContent.tsx b/src/figma-make/components/pages/list-daily-checklist/ListDailyChecklistContent.tsx index 9936a31f..26df4283 100644 --- a/src/figma-make/components/pages/list-daily-checklist/ListDailyChecklistContent.tsx +++ b/src/figma-make/components/pages/list-daily-checklist/ListDailyChecklistContent.tsx @@ -1,7 +1,7 @@ 'use client'; import { useState } from 'react'; -import { Eye, CheckCircle, XCircle, Search, Trash2 } from 'lucide-react'; +import { Eye, CheckCircle, XCircle, Search, Trash2, Edit } from 'lucide-react'; import { Card, CardContent } from '@/figma-make/components/base/card'; import { Button } from '@/figma-make/components/base/button'; import { Badge } from '@/figma-make/components/base/badge'; @@ -121,6 +121,16 @@ export function ListDailyChecklistContent() { ); }; + const handleEdit = (item: DailyChecklist) => { + const formattedDate = new Date(item.date).toISOString().split('T')[0]; + const kandangId = item.kandang.id; + const category = item.category; + + router.push( + `/daily-checklist/daily-checklist?date=${formattedDate}&kandang_id=${kandangId}&category=${category}` + ); + }; + const handleApprove = (item: DailyChecklist) => { setSelectedItem(item); setShowApproveModal(true); @@ -377,6 +387,19 @@ export function ListDailyChecklistContent() { Detail + + {row.original.status === 'DRAFT' && ( + + )} + {row.original.status === 'SUBMITTED' && ( <> + + {row.original.status === 'DRAFT' && ( + + )} ), },