'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' type Props = { isCurrent: boolean payload: Collection onClick: () => void } const Item: FC = ({ isCurrent, payload, onClick, }) => { const { locale } = useContext(I18n) return (
!isCurrent && onClick()} > {typeof payload.icon === 'string' ? (
) : ( )}
{payload.label[locale === 'en' ? 'en_US' : 'zh_Hans']}
) } export default React.memo(Item)