fix(lesson-preparation): 重命名 TreeNodeRow.children prop 为 childItems 避免 react/no-children-prop

This commit is contained in:
SpecialX
2026-07-04 11:36:41 +08:00
parent 8ff14fce1c
commit 85121c49a3
2 changed files with 5 additions and 5 deletions

View File

@@ -100,7 +100,7 @@ export function StructureTree() {
hasChildren={hasChildren}
isChildrenExpanded={isTreeNodeExpanded}
onToggleChildren={() => toggleTreeNode(node.id)}
children={childItems}
childItems={childItems}
/>
);
})}

View File

@@ -13,7 +13,7 @@ interface Props {
isChildrenExpanded?: boolean;
onToggleChildren?: () => void;
/** 子节点(如对话轮次) */
children?: { id: string; label: string; kind: string }[];
childItems?: { id: string; label: string; kind: string }[];
}
export function TreeNodeRow({
@@ -22,7 +22,7 @@ export function TreeNodeRow({
hasChildren,
isChildrenExpanded,
onToggleChildren,
children,
childItems,
}: Props) {
const t = useTranslations("lessonPreparation");
const selectedNodeId = useLessonPlanEditor((s) => s.selectedNodeId);
@@ -116,7 +116,7 @@ export function TreeNodeRow({
)}
</div>
{hasChildren && isChildrenExpanded && children && (
{hasChildren && isChildrenExpanded && childItems && (
<div
style={{
marginLeft: 10,
@@ -124,7 +124,7 @@ export function TreeNodeRow({
borderLeft: "1px solid var(--border)",
}}
>
{children.map((c) => (
{childItems.map((c) => (
<div
key={c.id}
style={{