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