/** * @file Section component for the interaction help panel. */ import * as React from "react"; import type { NodeEditorPointerAction, NodeEditorShortcutAction, } from "../../../types/interaction"; import { InspectorShortcutButton } from "../../inspector/parts/InspectorShortcutButton"; import { InteractionHelpItem, type SectionItemView, } from "./InteractionHelpItem"; import styles from "./InteractionHelpSection.module.css"; export type SectionView = { id: string; title: string; items: SectionItemView[]; }; type CaptureState = | { type: "keyboard"; action: NodeEditorShortcutAction } | { type: "pointer"; action: NodeEditorPointerAction } | null; export type InteractionHelpSectionProps = { section: SectionView; captureState: CaptureState; keyboardPrompt: string; pointerPrompt: string; unassignedLabel: string; resetLabel: string; onResetSection: () => void; onSelectItem: (item: SectionItemView) => void; onResetItem: (item: SectionItemView) => void; }; const InteractionHelpSectionInner: React.FC = ({ section, captureState, keyboardPrompt, pointerPrompt, unassignedLabel, resetLabel, onResetSection, onSelectItem, onResetItem, }) => { return (
{section.title}
{resetLabel}
); }; export const InteractionHelpSection = React.memo(InteractionHelpSectionInner); InteractionHelpSection.displayName = "InteractionHelpSection";