import React from "react"; type ProfileAddressCardProps = { type: string; title: string; address: string; storagePeriod?: string; workTime?: string; comment?: string; onEdit?: () => void; onDelete?: () => void; onSelectMain?: () => void; isMain?: boolean; }; const ProfileAddressCard: React.FC = ({ type, title, address, storagePeriod, workTime, comment, onEdit, onDelete, onSelectMain, isMain }) => (
{type}
{title}
{address}
{storagePeriod && workTime && (
Срок хранения
{storagePeriod}
Ежедневно
{workTime}
)} {comment && (
Комментарий
{comment}
)}
(e.key === 'Enter' || e.key === ' ') && onEdit && onEdit()} onMouseEnter={e => { const svg = (e.currentTarget as HTMLElement).querySelector('img'); if (svg) (svg as HTMLImageElement).style.filter = 'invert(32%) sepia(97%) saturate(7490%) hue-rotate(355deg) brightness(97%) contrast(108%)'; }} onMouseLeave={e => { const svg = (e.currentTarget as HTMLElement).querySelector('img'); if (svg) (svg as HTMLImageElement).style.filter = ''; }} > edit
Редактировать
(e.key === 'Enter' || e.key === ' ') && onDelete && onDelete()} onMouseEnter={e => { const path = e.currentTarget.querySelector('path'); if (path) path.setAttribute('fill', '#ec1c24'); }} onMouseLeave={e => { const path = e.currentTarget.querySelector('path'); if (path) path.setAttribute('fill', '#D0D0D0'); }} >
Удалить
{onSelectMain && (
{isMain && ( )}
Выбрать как основной адрес
)}
); export default ProfileAddressCard;