- Implemented TransactionIndex component for displaying transactions with pagination and filtering options. - Created TransactionCardRow component for rendering individual transaction details. - Added TransactionItemSubRow component for displaying detailed order items within a transaction. - Integrated delete confirmation dialog for transaction deletion. - Updated routes to include transaction management with appropriate permissions.
24 lines
566 B
TypeScript
24 lines
566 B
TypeScript
import { useDraftSave } from '@/hooks/use-draft-save';
|
|
import {
|
|
clearTransactionDraft,
|
|
saveTransactionDraft,
|
|
} from '@/lib/transaction-draft';
|
|
import type { TransactionDraftData } from '@/lib/transaction-draft';
|
|
|
|
type DraftType = 'create' | 'edit';
|
|
|
|
export function useTransactionDraftSave(
|
|
type: DraftType,
|
|
data: TransactionDraftData,
|
|
userId?: number,
|
|
delay = 500,
|
|
) {
|
|
return useDraftSave({
|
|
type,
|
|
data,
|
|
userId,
|
|
delay,
|
|
store: { save: saveTransactionDraft, clear: clearTransactionDraft },
|
|
});
|
|
}
|