diff --git a/src/app/[locale]/status/[uuid]/page.tsx b/src/app/[locale]/status/[uuid]/page.tsx index f748b6f..56adeb8 100644 --- a/src/app/[locale]/status/[uuid]/page.tsx +++ b/src/app/[locale]/status/[uuid]/page.tsx @@ -8,9 +8,12 @@ export default async function StatusPage({ }) { const { locale, uuid } = await params const t = await getTranslations({ locale, namespace: 'status' }) + return ( -
-

{t('heading')}

+
+

+ {t('heading')} +

) diff --git a/src/components/StatusView.tsx b/src/components/StatusView.tsx index a442cea..a96cbe8 100644 --- a/src/components/StatusView.tsx +++ b/src/components/StatusView.tsx @@ -15,6 +15,15 @@ type DownloadData = { tokenExpiresAt: string | null } +function Spinner() { + return ( + + + + + ) +} + export function StatusView({ uuid }: { uuid: string }) { const t = useTranslations('status') const locale = useLocale() @@ -45,14 +54,33 @@ export function StatusView({ uuid }: { uuid: string }) { return () => { active = false } }, [uuid]) - if (notFound) return

{t('notFound')}

- if (!data) return

{t('loading')}

+ const cardClass = 'max-w-md w-full mx-auto rounded-2xl border border-gray-100 dark:border-slate-800 bg-gray-50 dark:bg-slate-900 p-8' + + if (notFound) { + return ( +
+

{t('notFound')}

+
+ ) + } + + if (!data) { + return ( +
+ +

{t('loading')}

+
+ ) + } if (data.status === 'PENDING' || data.status === 'PROCESSING') { return ( -
-

{data.status === 'PENDING' ? t('pending') : t('processing')}

-

{t('polling')}

+
+ +

+ {data.status === 'PENDING' ? t('pending') : t('processing')} +

+

{t('polling')}

) } @@ -62,16 +90,24 @@ export function StatusView({ uuid }: { uuid: string }) { ? `(${(Number(data.fileSize) / 1_048_576).toFixed(1)} MB)` : '' return ( -
-

{t('ready')} {sizeMb}

+
+
+ + + +
+

+ {t('ready')} {sizeMb} +

{t('download')} {data.fileName} {data.tokenExpiresAt && ( -

+

{t('linkExpires')}{' '} {new Date(data.tokenExpiresAt).toLocaleString(locale)}

@@ -82,9 +118,9 @@ export function StatusView({ uuid }: { uuid: string }) { if (data.status === 'FAILED') { return ( -
-

{t('failed')}

-
+      
+

{t('failed')}

+
           {data.errorMsg}
         
@@ -92,8 +128,16 @@ export function StatusView({ uuid }: { uuid: string }) { } if (data.status === 'FILE_DELETED') { - return

{t('deleted')}

+ return ( +
+

{t('deleted')}

+
+ ) } - return

{t('unknown')}: {data.status}

+ return ( +
+

{t('unknown')}: {data.status}

+
+ ) }