fix: remove all 'Сохранение...' text, show toast popup on save instead

This commit is contained in:
2026-03-24 22:44:22 +03:00
parent 0ae8f57cde
commit 8ecebe686c
2 changed files with 12 additions and 23 deletions

View File

@@ -87,29 +87,19 @@ export function SectionEditor<T>({
return (
<div>
<div className="flex items-center justify-between gap-4">
<h1 className="text-2xl font-bold">{title}</h1>
<div className="flex items-center gap-2 text-sm text-neutral-400">
{status === "saving" && (
<>
<Loader2 size={14} className="animate-spin" />
<span>Сохранение...</span>
</>
)}
{status === "saved" && (
<>
<Check size={14} className="text-emerald-400" />
<span className="text-emerald-400">Сохранено</span>
</>
)}
{status === "error" && (
<>
<AlertCircle size={14} className="text-red-400" />
<span className="text-red-400">{error}</span>
</>
)}
</div>
{/* Fixed toast popup */}
{(status === "saved" || status === "error") && (
<div className={`fixed bottom-4 right-4 z-50 flex items-center gap-2 rounded-lg border px-3 py-2 text-sm shadow-lg animate-in slide-in-from-right ${
status === "saved"
? "bg-emerald-950/90 border-emerald-500/30 text-emerald-200"
: "bg-red-950/90 border-red-500/30 text-red-200"
}`}>
{status === "saved" && <><Check size={14} /> Сохранено</>}
{status === "error" && <><AlertCircle size={14} /> {error}</>}
</div>
)}
<div className="mt-6 space-y-6">{children(data, setData)}</div>
</div>

View File

@@ -531,7 +531,6 @@ export default function OpenDayAdminPage() {
<div className="flex items-center justify-between">
<div>
<h1 className="text-2xl font-bold">День открытых дверей</h1>
{saving && <span className="text-xs text-neutral-500">Сохранение...</span>}
</div>
<button
onClick={deleteEvent}