import { BillPayApprovalRuleWithUser, RemiApprovalRuleWithUser } from '@zeniai/client-epic-state'; /** * The setup-approver view selectors alias the same underlying * `ApprovalRuleWithUser` shape across bills and reimbursements. */ export type ApprovalRuleWithUser = BillPayApprovalRuleWithUser | RemiApprovalRuleWithUser; export interface DialogAction { onCancelClick: () => void; onOkClick: (notes?: string) => void; } /** * react-dnd item shape carried while dragging a rule card. Carries * the source rule's id so the drop target can issue an * 'onReorder(sourceId, targetId)' callback to the parent on release. */ export interface RuleDragItem { ruleId: string; } /** react-dnd type discriminator for approval-rule cards. */ export declare const APPROVAL_RULE_DND_TYPE = "approval-rule"; export interface Props { approvalRule: ApprovalRuleWithUser; isLastSection: boolean; showDeleteBtn: boolean; /** * Optional department-id → display-name map. In this codebase * "department" maps to the Class entity (accounting class); the list * page derives this from `state.classState`. */ departmentNamesById?: Record; disableButtons?: boolean; /** * Number rendered before the rule name (e.g. "1. Marketing vendor block"). * Defaults to `approvalRule.priority`. */ positionNumber?: number; /** * Optional vendor-id → display-name map. The list page derives this * from `state.contactState` (vendors are stored as contacts). Chips * fall back to the raw ID when no entry is found. */ vendorNamesById?: Record; onDeleteRuleClick: (ruleId: string) => void; onEditRuleClick: (ruleId?: string) => void; /** * Called when the user drops THIS card (drop target) after dragging * another rule onto it. Receives the source and target rule ids; * the list page composes the new order and dispatches the reorder * action. Optional — when omitted the card renders without a drag * handle and is not draggable. */ onReorderRules?: (dragRuleId: string, hoverRuleId: string) => void; } /** * Approval rule list-page card per Approval Rules 3.0. * * Handles both regular rules and the fallback rule (isFallback === true). * Fallback cards render a shield icon, no drag handle, no position number, * no kebab menu, and a static "No rule matches" chip in the When section. * * ┌─────────────────────────────────────────────────────────┐ * │ 1. Marketing vendor block [Separation of Duties] ⋮│ * │ All marketing bills route through department lead │ * │ When: [Amount > $1,000] [Department is Sales & Mktg] │ * │ Then: ① Require approval from Jordan Leo or Elena King │ * │ ② Require approval from Matteo Ramsey │ * └─────────────────────────────────────────────────────────┘ */ declare const ApprovalRuleSection: ({ approvalRule, isLastSection, disableButtons, onDeleteRuleClick, onEditRuleClick, vendorNamesById, departmentNamesById, positionNumber, onReorderRules, }: Props) => import("react/jsx-runtime").JSX.Element; export default ApprovalRuleSection;