'use client' import type { FC } from 'react' import React from 'react' import cn from 'classnames' import { useTranslation } from 'react-i18next' import { Edit03, Pin02, Trash03 } from '../../base/icons/src/vender/line/general' import s from './style.module.css' import Popover from '@/app/components/base/popover' export type IItemOperationProps = { className?: string isPinned: boolean isShowRenameConversation?: boolean onRenameConversation?: () => void isShowDelete: boolean togglePin: () => void onDelete: () => void } const ItemOperation: FC = ({ className, isPinned, togglePin, isShowRenameConversation, onRenameConversation, isShowDelete, onDelete, }) => { const { t } = useTranslation() return ( { e.stopPropagation() }}>
{isPinned ? t('explore.sidebar.action.unpin') : t('explore.sidebar.action.pin')}
{isShowRenameConversation && (
{t('explore.sidebar.action.rename')}
)} {isShowDelete && (
{t('explore.sidebar.action.delete')}
)} } trigger='click' position='br' btnElement={
} btnClassName={open => cn(className, s.btn, 'h-6 w-6 rounded-md border-none py-1', open && '!bg-gray-100 !shadow-none')} className={'!w-[120px] !px-0 h-fit !z-20'} /> ) } export default React.memo(ItemOperation)