fix(lesson-preparation): 重命名 TreeNodeRow.children prop 为 childItems 避免 react/no-children-prop
This commit is contained in:
@@ -100,7 +100,7 @@ export function StructureTree() {
|
||||
hasChildren={hasChildren}
|
||||
isChildrenExpanded={isTreeNodeExpanded}
|
||||
onToggleChildren={() => toggleTreeNode(node.id)}
|
||||
children={childItems}
|
||||
childItems={childItems}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -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={{
|
||||
|
||||
Reference in New Issue
Block a user