feat(app): sheet draft editor route, modes, recovery offer and conflict dialog
This commit is contained in:
1 parent
b14509f221
commit
6aba9711f0
44 files changed
+3143
-13
No files matched your search
@@ -0,0 +1,37 @@
|
||||
import type { TabTier } from './useViewport'
|
||||
|
||||
export const EDITOR_TABS = [
|
||||
'general',
|
||||
'views',
|
||||
'annotations',
|
||||
'findings',
|
||||
'references',
|
||||
'vertebrae',
|
||||
'verification',
|
||||
] as const
|
||||
export type EditorTabId = (typeof EDITOR_TABS)[number]
|
||||
|
||||
/** Board 05: the tabs shown beside « Plus » at each width; the rest sit under « Plus ». */
|
||||
const SHOWN: Record<TabTier, readonly EditorTabId[]> = {
|
||||
wide: EDITOR_TABS,
|
||||
medium: ['general', 'annotations', 'findings', 'verification'],
|
||||
small: ['annotations', 'verification'],
|
||||
}
|
||||
|
||||
export function tabsFor(tier: TabTier): {
|
||||
shown: readonly EditorTabId[]
|
||||
more: readonly EditorTabId[]
|
||||
} {
|
||||
const shown = SHOWN[tier]
|
||||
return { shown, more: EDITOR_TABS.filter((tab) => !shown.includes(tab)) }
|
||||
}
|
||||
|
||||
/** Props of every tab body (Lots F-J fill them): read-only flag, tab jump, sheet reload. */
|
||||
export interface EditorTabProps {
|
||||
/** Not editable now: a mode that cannot save, or a recovery offer not answered yet. */
|
||||
readOnly: boolean
|
||||
/** « Aller à … » and any link between tabs. */
|
||||
onSelectTab: (tab: EditorTabId) => void
|
||||
/** Reads the sheet's overview again (after a submission: the round freezes the draft). */
|
||||
reloadSheet: () => void
|
||||
}
|
||||
Reference in new issue
Block a user