'use client'; import { useEffect } from 'react'; import type { ParsedJournal } from '@/lib/journal'; import PasswordField from '../fields/PasswordField'; import { IconX } from '../Icons'; type Frontmatter = ParsedJournal['frontmatter']; interface PageSettingsPanelProps { frontmatter: Frontmatter; onChange: (updates: Partial) => void; onClose: () => void; } /** * A content page's settings inside the editor (#722): a side panel rather than * the journal's modal, so the preview stays in view. The slug and the menu * place are edited in Pages, where the collision check and the menu live. */ export function PageSettingsPanel({ frontmatter, onChange, onClose }: PageSettingsPanelProps) { useEffect(() => { const onKey = (e: KeyboardEvent) => { if (e.key === 'Escape') onClose(); }; window.addEventListener('keydown', onKey); return () => window.removeEventListener('keydown', onKey); }, [onClose]); return (