import { useAccount } from '@gear-js/react-hooks'; import { TimestampBlock } from '@/shared/ui/timestampBlock'; import { IdBlock, OwnerBlock } from '@/shared/ui'; import { Dns } from '../../types'; import { EditDns } from '../edit-dns'; import { DeleteDns } from '../delete-dns'; import styles from './dns-card.module.scss'; type Props = { dns: Dns; onSuccess: () => void; }; function DnsCard({ dns, onSuccess }: Props) { const { name, address, updatedAt, createdAt, createdBy, admins } = dns; const { account } = useAccount(); const admin = admins[0]; const isOwner = createdBy === account?.decodedAddress; const timePrefix = updatedAt === createdAt ? 'Created at:' : 'Updated at:'; const ownerButtonText = admin === account?.decodedAddress ? '(you)' : undefined; return (