brackt/app/components/league/settings/SettingsSaveBar.tsx
Chris Parsons b1a1a472f5 Refactor league settings into per-section components (#347)
Extract all settings sections from the monolithic 1009-line route file into
individual components under app/components/league/settings/. Route file drops
to ~300 lines. Separates draft-order dirty state from general settings dirty
state, deduplicates section-change handling, and fixes several bugs found
during review (typo in pointsFor5th, wrong mock in tests, lint violations).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 14:00:35 -07:00

31 lines
868 B
TypeScript

import { Button } from "~/components/ui/button";
export function SettingsSaveBar({
hasUnsavedChanges,
isSubmitting,
onReset,
}: {
hasUnsavedChanges: boolean;
isSubmitting: boolean;
onReset: () => void;
}) {
return (
<div className="space-y-3">
{hasUnsavedChanges && (
<p className="mb-3 text-sm font-medium text-amber-700 dark:text-amber-300">
You have unsaved settings changes.
</p>
)}
<div className="flex flex-col gap-2 sm:flex-row">
{hasUnsavedChanges && (
<Button type="button" variant="outline" className="h-12 sm:w-48" onClick={onReset}>
Reset Changes
</Button>
)}
<Button type="submit" className="h-12 flex-1" disabled={isSubmitting}>
{isSubmitting ? "Saving..." : "Save Settings"}
</Button>
</div>
</div>
);
}