refactor: Simplify dataset navigation and avatar display logic

This commit is contained in:
twwu 2025-09-10 11:00:49 +08:00
parent 9fdaa14c8d
commit 9ae6978a77
2 changed files with 1 additions and 3 deletions

View File

@ -21,7 +21,7 @@ export const CredentialIcon: React.FC<CredentialIconProps> = ({
size = 20,
className = '',
}) => {
const [showAvatar, setShowAvatar] = useState(!!avatar_url)
const [showAvatar, setShowAvatar] = useState(true)
const firstLetter = useMemo(() => name.charAt(0).toUpperCase(), [name])
const bgColor = useMemo(() => ICON_BG_COLORS[firstLetter.charCodeAt(0) % ICON_BG_COLORS.length], [firstLetter])

View File

@ -65,8 +65,6 @@ const DatasetNav = () => {
const runtimeMode = currentDataset?.runtime_mode
if (runtimeMode === 'rag_pipeline')
return `${basePath}/datasets/create-from-pipeline`
else if (runtimeMode === 'general')
return `${basePath}/datasets/create`
else
return `${basePath}/datasets/create`
}, [currentDataset?.runtime_mode])