diff --git a/frontend/src/admin/components/NodeDetailDrawer.tsx b/frontend/src/admin/components/NodeDetailDrawer.tsx index 0eaf2a6..ea6b974 100644 --- a/frontend/src/admin/components/NodeDetailDrawer.tsx +++ b/frontend/src/admin/components/NodeDetailDrawer.tsx @@ -13,6 +13,7 @@ type DrawerTab = 'basics' | 'location' | 'game' | 'messages' | 'advanced' type NodeDetailDrawerProps = { stage: AdminReactOverviewStage + stages?: AdminReactOverviewStage[] onClose: () => void onApplyLocal: (stage: AdminReactOverviewStage) => void onDeleteLocal: (stage: AdminReactOverviewStage) => void @@ -31,8 +32,33 @@ function numberOrNull(value: string) { return Number.isFinite(parsed) ? parsed : null } +function getPhysicalRequirementOption(stage: AdminReactOverviewStage) { + const record = stage as AdminReactOverviewStage & { + physical_node_kind?: string + physical_item_kind?: string + physical_item_id?: string + physical_item_label?: string + physical_qr?: { item_id?: string; label?: string; kind?: string } + } + + const kind = record.physical_node_kind || record.physical_item_kind || record.physical_qr?.kind + const itemId = record.physical_item_id || record.physical_qr?.item_id + const label = record.physical_item_label || record.physical_qr?.label || stage.title || itemId + + if (!itemId) return null + if (kind !== 'collectible' && kind !== 'requirement' && kind !== 'clue' && kind !== 'bonus') return null + + return { + itemId, + label: label || itemId, + title: stage.title || label || itemId, + kind, + } +} + export default function NodeDetailDrawer({ stage, + stages = [], onClose, onApplyLocal, onDeleteLocal, @@ -60,6 +86,10 @@ export default function NodeDetailDrawer({ ? (((draft as EditableAdminStage).config || {}) as Record) : {} + const physicalRequirementOptions = stages + .map(getPhysicalRequirementOption) + .filter((item): item is NonNullable> => Boolean(item)) + function getDraftConfigText(key: string, fallback = '') { const value = draftConfig[key] if (Array.isArray(value)) return value.join(', ') @@ -448,6 +478,32 @@ export default function NodeDetailDrawer({ {t('editor.gameAuthoring.completionHelp')} + +