'use client'; import Button from '@/components/Button'; import Tooltip from '@/components/Tooltip'; import { cn } from '@/lib/helper'; import { Icon } from '@iconify/react'; type FloatingActionsButtonProps = { actions: { action: 'DETAIL' | 'EDIT' | 'DELETE'; icon: string; label?: string; onClick?: () => void; hidden?: boolean; disabled?: boolean; }[]; approvals: { action: 'APPROVED' | 'REJECTED'; icon: string; label?: string; onClick?: () => void; disabled?: boolean; }[]; selectedRowIds: number[]; onClose: () => void; }; const FloatingActionsButton = ({ actions, approvals, selectedRowIds, onClose, }: FloatingActionsButtonProps) => { // Jika tidak ada baris yang dipilih, jangan tampilkan FAB const positionStyles = selectedRowIds.length > 0 ? 'bottom-[10%]' : 'bottom-[-100%]'; // Helper untuk menentukan gaya warna tombol approval const getApprovalColor = (action: 'APPROVED' | 'REJECTED') => { if (action === 'APPROVED') return 'success'; if (action === 'REJECTED') return 'error'; return 'primary'; }; const getActionColor = (action: 'DETAIL' | 'EDIT' | 'DELETE') => { if (action === 'DETAIL') return 'white'; if (action === 'EDIT') return 'warning'; if (action === 'DELETE') return 'error'; return 'primary'; }; return ( // Container utama FAB