Skip to content

Commit 00a23e0

Browse files
authored
fix: moving finance reset button and adding description #44
1 parent aa2f460 commit 00a23e0

1 file changed

Lines changed: 17 additions & 7 deletions

File tree

‎src/components/finance/FinanceManager.tsx‎

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,6 @@ export function FinanceManager({ initial }: { initial: FinanceData }) {
256256
<DataTableCardHeader
257257
title="STF school year"
258258
description={`Active school year: ${activeQuarter?.name ?? "None"}`}
259-
action={
260-
activeQuarter ? (
261-
<Button variant="destructive" onClick={() => setResetStep(1)}>
262-
Reset school year
263-
</Button>
264-
) : null
265-
}
266259
/>
267260
{!activeQuarter ? (
268261
<div className="flex flex-wrap items-end gap-3 p-4">
@@ -488,6 +481,23 @@ export function FinanceManager({ initial }: { initial: FinanceData }) {
488481
</DataTableCard>
489482
</section>
490483

484+
{activeQuarter ? (
485+
<div className="border-border bg-card flex flex-wrap items-center justify-between gap-3 rounded-lg border p-4">
486+
<div className="max-w-prose space-y-1">
487+
<h2 className="text-lg font-semibold">Reset school year</h2>
488+
<p className="text-muted-foreground text-sm">
489+
Archives every STF bucket for <strong>{activeQuarter.name}</strong> and
490+
clears them for a fresh school year. The gift fund is not affected. This
491+
cannot be undone.{" "}
492+
<strong>Only run at the start of a new school year!</strong>
493+
</p>
494+
</div>
495+
<Button variant="destructive" onClick={() => setResetStep(1)}>
496+
Reset school year
497+
</Button>
498+
</div>
499+
) : null}
500+
491501
<Dialog open={resetStep > 0} onOpenChange={(open) => !open && setResetStep(0)}>
492502
<DialogContent overlayClassName="bg-destructive/20">
493503
{resetStep === 1 ? (

0 commit comments

Comments
 (0)