'use client' import type { FC } from 'react' import React from 'react' import { useContext } from 'use-context-selector' import cn from 'classnames' import AppIcon from '../../base/app-icon' import type { Collection } from '@/app/components/tools/types' import I18n from '@/context/i18n' import { getModelRuntimeSupported } from '@/utils/language' type Props = { isCurrent: boolean payload: Collection onClick: () => void } const Item: FC = ({ isCurrent, payload, onClick, }) => { const { locale } = useContext(I18n) const language = getModelRuntimeSupported(locale) return (
!isCurrent && onClick()} > {typeof payload.icon === 'string' ? (
) : ( )}
{payload.label[language]}
) } export default React.memo(Item)