"use client"; import { useState } from "react"; import { AddAccountButton, EditAccountButton } from "./account-form"; import { RowActionsMenu, RowActionsItem, RowActionsDestructiveItem, RowActionsSeparator } from "@/components/ui/row-actions-menu"; import { DeleteConfirmDialog } from "@/components/ui/delete-confirm-dialog"; import { ConfirmDialog } from "@/components/ui/confirm-dialog"; import { deleteAccount, toggleAccountActive } from "./actions"; type AccountItem = { id: string; code: string; name: string; description: string | null; isActive: boolean; parentId: string | null; children: AccountItem[]; }; type ParentOption = { id: string; code: string; name: string; parentId: string | null }; function AccountActionsMenu({ account, allAccounts, }: { account: AccountItem; allAccounts: ParentOption[]; }) { const [editOpen, setEditOpen] = useState(false); const [deleteOpen, setDeleteOpen] = useState(false); const [toggleOpen, setToggleOpen] = useState(false); return ( <> setEditOpen(true)}>Edit setToggleOpen(true)}> {account.isActive ? "Deactivate" : "Activate"} setDeleteOpen(true)}>Delete deleteAccount(account.id)} />