mirror of
https://github.com/langgenius/dify.git
synced 2026-04-28 11:56:55 +08:00
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,
|
size = 20,
|
||||||
className = '',
|
className = '',
|
||||||
}) => {
|
}) => {
|
||||||
const [showAvatar, setShowAvatar] = useState(!!avatar_url)
|
const [showAvatar, setShowAvatar] = useState(true)
|
||||||
const firstLetter = useMemo(() => name.charAt(0).toUpperCase(), [name])
|
const firstLetter = useMemo(() => name.charAt(0).toUpperCase(), [name])
|
||||||
const bgColor = useMemo(() => ICON_BG_COLORS[firstLetter.charCodeAt(0) % ICON_BG_COLORS.length], [firstLetter])
|
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
|
const runtimeMode = currentDataset?.runtime_mode
|
||||||
if (runtimeMode === 'rag_pipeline')
|
if (runtimeMode === 'rag_pipeline')
|
||||||
return `${basePath}/datasets/create-from-pipeline`
|
return `${basePath}/datasets/create-from-pipeline`
|
||||||
else if (runtimeMode === 'general')
|
|
||||||
return `${basePath}/datasets/create`
|
|
||||||
else
|
else
|
||||||
return `${basePath}/datasets/create`
|
return `${basePath}/datasets/create`
|
||||||
}, [currentDataset?.runtime_mode])
|
}, [currentDataset?.runtime_mode])
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user