diff --git a/components/ui/filter-bar.tsx b/components/ui/filter-bar.tsx deleted file mode 100644 index e6a83dc..0000000 --- a/components/ui/filter-bar.tsx +++ /dev/null @@ -1,176 +0,0 @@ -import React from 'react'; -import { motion, AnimatePresence } from 'framer-motion'; -import { X, Check, ChevronDown } from 'lucide-react'; -import * as Popover from '@radix-ui/react-popover'; -import { mockSceneOptions, mockCharacterOptions } from '@/app/model/enums'; - -interface FilterBarProps { - selectedScenes: string[]; - selectedCharacters: string[]; - onScenesChange: (scenes: string[]) => void; - onCharactersChange: (characters: string[]) => void; - onReset: () => void; -} - -const MultiSelect: React.FC<{ - label: string; - options: { id: string; name: string }[]; - selected: string[]; - onChange: (values: string[]) => void; -}> = ({ label, options, selected, onChange }) => { - return ( -
- - - - - - - - -
- {options.map((option) => ( - { - const newSelected = selected.includes(option.id) - ? selected.filter(id => id !== option.id) - : [...selected, option.id]; - onChange(newSelected); - }} - className="relative w-full flex items-center px-8 py-2 rounded-md text-sm text-gray-200 - hover:bg-white/5 cursor-pointer outline-none" - whileHover={{ scale: 1.02 }} - whileTap={{ scale: 0.98 }} - > - - {selected.includes(option.id) && ( - - - - )} - - {option.name} - - ))} -
-
-
-
-
- ); -}; - -const FilterBar: React.FC = ({ - selectedScenes, - selectedCharacters, - onScenesChange, - onCharactersChange, - onReset, -}) => { - const sceneOptions = mockSceneOptions.map(scene => ({ - id: scene.sceneId, - name: scene.name, - })); - - const characterOptions = mockCharacterOptions.map(char => ({ - id: char.characterId, - name: char.name, - })); - - return ( - -
- - - - - -
- - {/* 当前筛选条件 */} - - {(selectedScenes.length > 0 || selectedCharacters.length > 0) && ( - - {selectedScenes.map((sceneId) => { - const scene = mockSceneOptions.find(s => s.sceneId === sceneId); - return scene && ( - - 场景:{scene.name} - - ); - })} - {selectedCharacters.map((charId) => { - const char = mockCharacterOptions.find(c => c.characterId === charId); - return char && ( - - 角色:{char.name} - - ); - })} - - )} - -
- ); -}; - -export default FilterBar; \ No newline at end of file diff --git a/components/ui/keyword-text.tsx b/components/ui/keyword-text.tsx deleted file mode 100644 index ab8b142..0000000 --- a/components/ui/keyword-text.tsx +++ /dev/null @@ -1,137 +0,0 @@ -import React from 'react'; -import * as Tooltip from '@radix-ui/react-tooltip'; -import { characterInfoMap, sceneInfoMap, mockCharacterOptions, mockSceneOptions } from '@/app/model/enums'; -import { motion } from 'framer-motion'; - -interface KeywordTextProps { - text: string; - className?: string; - id?: string; -} - -const KeywordText: React.FC = ({ text, className = '', id }) => { - // 解析文本中的关键词 - const parseText = (text: string) => { - const parts: React.ReactNode[] = []; - let currentIndex = 0; - - // 匹配 #角色# 和 [场景] - const regex = /#([^#]+)#|\[([^\]]+)\]/g; - let match; - - while ((match = regex.exec(text)) !== null) { - // 添加普通文本 - if (match.index > currentIndex) { - parts.push(text.slice(currentIndex, match.index)); - } - - const [fullMatch, character, scene] = match; - if (character) { - // 角色关键词 - const info = mockCharacterOptions.find(option => option.characterId === id); - if (info) { - parts.push( - - - - - #{character}# - - - - -
- {character} -
-
{character}
-
- {info.gender} · {info.age}岁 -
-
- {info.description} -
-
-
- -
-
-
-
- ); - } else { - parts.push(#{character}#); - } - } else if (scene) { - // 场景关键词 - const info = mockSceneOptions.find(option => option.sceneId === id); - console.log('info', info); - if (info) { - parts.push( - - - - - [{scene}] - - - - -
- {scene} -
{scene}
-
- {info.location} · {info.time} -
-
- -
-
-
-
- ); - } else { - parts.push([{scene}]); - } - } - - currentIndex = match.index + fullMatch.length; - } - - // 添加剩余文本 - if (currentIndex < text.length) { - parts.push(text.slice(currentIndex)); - } - - return parts; - }; - - return ( - - {parseText(text)} - - ); -}; - -export default KeywordText; \ No newline at end of file