type Props = { errors: Partial>; }; export function SupportAttachmentErrors({ errors }: Props) { const messages = Object.entries(errors) .filter( ([key, message]) => Boolean(message) && (key === 'attachments' || key.startsWith('attachments.')), ) .map(([key, message]) => ({ key, message: message as string, })); if (messages.length === 0) { return null; } return (
{messages.map((item) => (
{item.message}
))}
); }