import { Box, IconButton, PopoverMenu, TableListItem, Text, Tooltip, } from '@wix/design-system'; import React, { CSSProperties, useMemo } from 'react'; import { DeleteSmall, LockLockedFilledSmall, MoreSmall, UndoSmall, } from '@wix/wix-ui-icons-common'; import { useWixPatternsContainer, usePageContext } from '@wix/bex-core/react'; import type { ArchivedItem } from './types'; export interface ArchivedItemsListItemProps { item: ArchivedItem; showDivider?: boolean; onRestore: (item: ArchivedItem) => void; onDelete: (item: ArchivedItem) => void; dataHook?: string; } function _ArchivedItemsListItem({ item, showDivider, onRestore, onDelete, dataHook = 'custom-columns', }: ArchivedItemsListItemProps) { const { translate: t } = useWixPatternsContainer(); const { stackingRootRef } = usePageContext(); const isPii = item.isPii; const style = useMemo( () => ({ padding: '0 6px', wordBreak: 'break-word', }), [], ); const moreActionsButton = ( } > } text={t('cairo.archivedFields.more-actions.restore')} onClick={() => onRestore(item)} /> } text={t('cairo.archivedFields.more-actions.delete')} onClick={() => onDelete(item)} /> ); return (
{item.label || item.id}
), }, { value: ( {isPii && ( )} {moreActionsButton} ), align: 'right' as const, }, ]} /> ); } export const ArchivedItemsListItem = _ArchivedItemsListItem;