/** How a confirm dialog colours its primary action. */ export type ConfirmDialogTone = 'default' | 'destructive'; /** * Centralised copy for confirmation dialogs. Keeping the text out of the * call sites lets a single place own wording for destructive actions and * makes it obvious from the constant name which scenario is being guarded. */ /** Static, scenario-typed text bundle consumed by ````. */ export interface ConfirmTexts { title: string; description: string; confirmLabel: string; cancelLabel: string; tone: ConfirmDialogTone; /** Optional label shown on the confirm button while the action runs. */ busyLabel?: string; } /** * Stop-tracking a previously-adopted chat theme. Hard-deletes the * ``visibility_prompts`` row created from the theme. * * @param {string} themeLabel - Human-readable theme name to quote in copy. * @returns {ConfirmTexts} Pre-formatted texts for the confirm modal. */ export const stopTrackingChatThemeTexts = ( themeLabel: string ): ConfirmTexts => ({ title: 'Stop tracking this chat theme?', description: `Stop tracking "${themeLabel}"? This permanently deletes the AI-search prompt created from this theme. This cannot be undone.`, confirmLabel: 'Stop tracking', cancelLabel: 'Cancel', tone: 'destructive', busyLabel: 'Stopping...', }); /** * Hard-delete an article and its full version history. * * @param {string} articleTitle - Human-readable article title for the prompt. * @returns {ConfirmTexts} Pre-formatted texts for the confirm modal. */ export const deleteArticleTexts = (articleTitle: string): ConfirmTexts => ({ title: 'Delete this content?', description: `Delete "${articleTitle}"? This hard-deletes the content and all version history. This cannot be undone.`, confirmLabel: 'Delete', cancelLabel: 'Cancel', tone: 'destructive', busyLabel: 'Deleting...', }); /** * Regenerate a social post with one citation fix as its directive. * * @param {number} credits - What the regeneration costs. * @returns {ConfirmTexts} Pre-formatted texts for the confirm modal. */ export const regenerateWithFixTexts = (credits: number): ConfirmTexts => ({ title: 'Regenerate with this fix?', description: `The post is written again with this fix as its directive and scored again. It costs ${credits} credits, like any post; the current text stays in Versions.`, confirmLabel: 'Regenerate', cancelLabel: 'Cancel', tone: 'default', busyLabel: 'Starting...', });