mirror of https://github.com/langgenius/dify.git
refactor: Simplify dataset navigation and avatar display logic
This commit is contained in:
parent
9fdaa14c8d
commit
9ae6978a77
|
|
@ -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])
|
||||
|
||||
|
|
|
|||
|
|
@ -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])
|
||||
|
|
|
|||
Loading…
Reference in New Issue