import { memo, } from 'react' import { RiDeleteBinLine, RiEditLine, RiEqualizer2Line, } from '@remixicon/react' import Indicator from '@/app/components/header/indicator' import Badge from '@/app/components/base/badge' import ActionButton from '@/app/components/base/action-button' import Tooltip from '@/app/components/base/tooltip' import Button from '@/app/components/base/button' import type { Credential } from '../types' import { CredentialTypeEnum } from '../types' type ItemProps = { credential: Credential disabled?: boolean onDelete?: (id: string) => void onEdit?: (id: string, values: Record) => void onSetDefault?: (id: string) => void } const Item = ({ credential, disabled, onDelete, onEdit, onSetDefault, }: ItemProps) => { const isOAuth = credential.credential_type === CredentialTypeEnum.OAUTH2 return (
{credential.name}
{ credential.is_default && ( Default ) }
{ isOAuth && ( ) } { !isOAuth && ( onEdit?.(credential.id, credential.credentials)} > ) } onDelete?.(credential.id)} >
) } export default memo(Item)