Skip to content

Commit e0bde60

Browse files
committed
refactor(ui): 移动并复用 isSkillSelected 函数
- 将 isSkillSelected 函数从 PromptInput.tsx 移动到 SlashCommandMenu.tsx - 在 PromptInput.tsx 中从 SlashCommandMenu 导入 isSkillSelected - 简化代码结构,避免函数重复定义 - 统一技能选择判断逻辑以提高代码复用性
1 parent b757ea1 commit e0bde60

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

src/ui/components/SkillsDropdown/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import DropdownMenu from "../../DropdownMenu";
22
import React, { useEffect, useState } from "react";
3-
import { isSkillSelected } from "../../PromptInput";
43
import type { SkillInfo } from "../../../session";
54
import { useInput } from "ink";
5+
import { isSkillSelected } from "../../SlashCommandMenu";
66

77
const SkillsDropdown: React.FC<{
88
open: boolean;

src/ui/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export {
2323
IMAGE_ATTACHMENT_CLEAR_HINT,
2424
formatImageAttachmentStatus,
2525
formatSelectedSkillsStatus,
26-
isSkillSelected,
2726
addUniqueSkill,
2827
toggleSkillSelection,
2928
removeCurrentSlashToken,

0 commit comments

Comments
 (0)