1 import { Button } from '@proton/atoms';
2 import type { FetchedBreaches } from '@proton/components/containers/credentialLeak/models';
3 import clsx from '@proton/utils/clsx';
5 import ReadableDate from './ReadableDate';
6 import { getBreachIcon } from './helpers';
8 import './BreachListItem.scss';
11 data: FetchedBreaches;
12 handleClick?: () => void;
20 hasMultipleAddresses?: boolean;
23 const BreachListItem = ({
33 const { name, email, createdAt, severity, exposedData } = data;
34 const { iconAltText } = style;
36 const breachIcon = getBreachIcon(severity, { resolved });
42 'w-full px-4 py-3 border-none',
43 selected ? 'breach-list-item-selected' : '',
44 disabled ? 'pointer-events-none' : ''
48 <span className="flex flex-nowrap items-start">
49 <span className="flex w-custom relative" style={{ '--w-custom': '1.875rem' }}>
50 <img src={breachIcon} className="m-auto w-full h-full" alt={iconAltText} />
52 <span className="flex-1 text-left pl-2 pr-1">
53 <span className={clsx('block max-w-full text-ellipsis', unread && 'text-bold')}>{name}</span>
54 {hasMultipleAddresses && (
57 'block max-w-full text-ellipsis color-weak text-sm',
68 'block max-w-full text-ellipsis m-0 text-sm color-weak',
72 <div className="text-ellipsis mt-1">
73 {exposedData?.map((data) => {
75 <span className="pr-2 inline-block" key={`${data.code}${data.name}`}>
76 <span className="text-sm rounded-full bg-norm border inline-block px-3 py-0.5">
90 export default BreachListItem;