mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 09:28:04 +08:00
refactor: Simplify dataset navigation and avatar display logic
This commit is contained in:
@ -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])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user