// Fullscreen form wrapper for the vault tab: sticky save bar + scrollable // content + header with a live dirty-state subtitle. Receives the // VaultController (`ctx`) for the item-type read; imports only from shared/, // the popup item-form component, and vault-context. import { renderItemForm } from '../popup/components/item-form'; import { type VaultController } from './vault-context'; // --------------------------------------------------------------------------- // Platform-aware save hint // --------------------------------------------------------------------------- const isMac = navigator.platform.toLowerCase().includes('mac'); const SAVE_HINT = isMac ? '⌘+S to save' : 'Ctrl+S to save'; // --------------------------------------------------------------------------- // Fullscreen form wrapper — sticky save bar + scrollable content + header // --------------------------------------------------------------------------- export function renderFormWrapped(ctx: VaultController, app: HTMLElement, mode: 'add' | 'edit'): void { const itemType = ctx.state.selectedItem?.type ?? ctx.state.newType ?? 'login'; const typeLabelText = itemType.replace('_', ' '); const titleText = mode === 'add' ? `new ${typeLabelText}` : `edit ${typeLabelText}`; const wrapper = document.createElement('div'); wrapper.className = 'form-pane'; wrapper.innerHTML = `