'use client'; // File: app/(dashboard)/settings/delegation/page.tsx // หน้าจัดการ Delegation ของตัวเอง (FR-011) import { useState } from 'react'; import { Plus, ArrowRightLeft, Trash2 } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Badge } from '@/components/ui/badge'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger, } from '@/components/ui/dialog'; import { useMyDelegations, useCreateDelegation, useRevokeDelegation, Delegation } from '@/hooks/use-delegation'; import { DelegationForm } from '@/components/delegation/DelegationForm'; export default function DelegationPage() { const [createOpen, setCreateOpen] = useState(false); const { data: delegations = [], isLoading } = useMyDelegations(); const createDelegation = useCreateDelegation(); const revokeDelegation = useRevokeDelegation(); const today = new Date().toISOString().split('T')[0]; return (
มอบหมายหน้าที่ตรวจสอบให้ผู้อื่นในช่วงที่ไม่อยู่
{d.startDate} → {d.endDate} {d.reason && ` • ${d.reason}`}
No delegations set. Create one when you need a proxy reviewer.