fix: improve query loading and error states

This commit is contained in:
2026-04-03 02:19:12 +03:00
parent 4d44632fbf
commit d7e21956db
9 changed files with 109 additions and 3 deletions

View File

@@ -0,0 +1,34 @@
export function LoadingPanel({ title = 'Загрузка...' }: { title?: string }) {
return (
<div className="grid min-h-[320px] place-items-center rounded-[16px] border border-[#24314f] bg-[#121b2e]">
<div className="text-center">
<div className="text-3xl font-semibold tracking-tight text-white">{title}</div>
<div className="mt-3 text-base text-slate-400">Подтягиваю данные и подготавливаю экран.</div>
</div>
</div>
)
}
export function ErrorPanel({
title = 'Не удалось загрузить данные',
description = 'Проверь соединение с сервером и попробуй ещё раз.',
onRetry,
}: {
title?: string
description?: string
onRetry?: () => void
}) {
return (
<div className="grid min-h-[320px] place-items-center rounded-[16px] border border-dashed border-[#31405f] bg-[#121b2e]">
<div className="max-w-xl text-center">
<div className="text-3xl font-semibold tracking-tight text-white">{title}</div>
<div className="mt-3 text-base text-slate-400">{description}</div>
{onRetry ? (
<button className="mt-6 rounded-[10px] bg-[#15c98b] px-6 py-3 text-base font-medium text-[#081225]" onClick={onRetry} type="button">
Повторить
</button>
) : null}
</div>
</div>
)
}