@seplan/diti-ds
Version:
Reusable UI component library developed by DITI (Technology and Innovation Directorate of SEPLAN PI) based on Mantine and Tailwind CSS
1 lines • 1.19 kB
Source Map (JSON)
{"version":3,"file":"ui.cjs","sources":["../src/components/errors/fetch-error.tsx"],"sourcesContent":["import { Alert } from '@mantine/core'\r\nimport { AlertTriangle } from 'lucide-react'\r\n\r\ninterface FetchErrorProps {\r\n error?: Error | string\r\n title?: string\r\n}\r\n\r\nexport function FetchError({\r\n error,\r\n title = 'Erro inesperado'\r\n}: FetchErrorProps) {\r\n const getErrorMessage = () => {\r\n if (!error) {\r\n return 'Ocorreu um erro inesperado'\r\n }\r\n if (typeof error === 'string') {\r\n return error\r\n }\r\n return error.message || 'Ocorreu um erro inesperado'\r\n }\r\n return (\r\n <Alert\r\n title={title}\r\n variant=\"light\"\r\n color=\"red\"\r\n className=\"max-w-xl\"\r\n icon={<AlertTriangle />}\r\n >\r\n {getErrorMessage()}\r\n </Alert>\r\n )\r\n}\r\n"],"names":["error","title","jsx","Alert","variant","color","className","icon","AlertTriangle","children","message"],"mappings":"ypFAQO,UAAoBA,MACzBA,EAAAC,MACAA,EAAQ,oBAWR,OACEC,EAAAA,IAACC,EAAAA,MAAA,CACCF,QACAG,QAAQ,QACRC,MAAM,MACNC,UAAU,WACVC,WAAOC,EAAAA,cAAA,IAENC,SAhBET,EAGgB,iBAAVA,EACFA,EAEFA,EAAMU,SAAW,6BALf,8BAkBb"}