feat(ui): shared record-scoped useDocumentDraft hook; fix half-wired invoice draft banner; dedupe draft keys
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
12
src/admin/lib/draftKeys.ts
Normal file
12
src/admin/lib/draftKeys.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Single source of truth for the localStorage keys used by the document-draft
|
||||
* autosave feature. Both the form (write side) and the list/banner (read side)
|
||||
* MUST import the key from here — duplicating the string literal in two files
|
||||
* means changing one silently breaks the other (the banner stops matching).
|
||||
*/
|
||||
export const DRAFT_KEYS = {
|
||||
offer: "boha_offer_draft",
|
||||
invoice: "boha_invoice_draft",
|
||||
} as const;
|
||||
|
||||
export type DraftKey = (typeof DRAFT_KEYS)[keyof typeof DRAFT_KEYS];
|
||||
Reference in New Issue
Block a user