forked from git.gladyson/openmonetis
- Replace ESLint with Biome for linting and formatting - Configure Biome with tabs, double quotes, and organized imports - Move all SQL/Drizzle queries from page.tsx files to data.ts files - Create new data.ts files for: ajustes, dashboard, relatorios/categorias - Update existing data.ts files: extrato, fatura (add lancamentos queries) - Remove all drizzle-orm imports from page.tsx files - Update README.md with new tooling info Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
59 lines
1.6 KiB
TypeScript
59 lines
1.6 KiB
TypeScript
"use client";
|
|
|
|
import { Checkbox } from "@/components/ui/checkbox";
|
|
import { cn } from "@/lib/utils/ui";
|
|
import type { SplitAndSettlementSectionProps } from "./lancamento-dialog-types";
|
|
|
|
export function SplitAndSettlementSection({
|
|
formState,
|
|
onFieldChange,
|
|
showSettledToggle,
|
|
}: SplitAndSettlementSectionProps) {
|
|
return (
|
|
<div className="flex w-full flex-col gap-2 py-2 md:flex-row">
|
|
<div
|
|
className={cn(
|
|
"space-y-1",
|
|
showSettledToggle ? "md:w-1/2 md:pr-2" : "md:w-full",
|
|
)}
|
|
>
|
|
<div className="flex items-center justify-between">
|
|
<div>
|
|
<p className="text-sm text-foreground">Dividir lançamento</p>
|
|
<p className="text-xs text-muted-foreground">
|
|
Selecione para atribuir parte do valor a outro pagador.
|
|
</p>
|
|
</div>
|
|
<Checkbox
|
|
checked={formState.isSplit}
|
|
onCheckedChange={(checked) =>
|
|
onFieldChange("isSplit", Boolean(checked))
|
|
}
|
|
aria-label="Dividir lançamento"
|
|
/>
|
|
</div>
|
|
</div>
|
|
|
|
{showSettledToggle ? (
|
|
<div className="space-y-1 md:w-1/2 md:pr-2">
|
|
<div className="flex items-center justify-between">
|
|
<div>
|
|
<p className="text-sm text-foreground">Marcar como pago</p>
|
|
<p className="text-xs text-muted-foreground">
|
|
Indica que o lançamento já foi pago ou recebido.
|
|
</p>
|
|
</div>
|
|
<Checkbox
|
|
checked={Boolean(formState.isSettled)}
|
|
onCheckedChange={(checked) =>
|
|
onFieldChange("isSettled", Boolean(checked))
|
|
}
|
|
aria-label="Marcar como concluído"
|
|
/>
|
|
</div>
|
|
</div>
|
|
) : null}
|
|
</div>
|
|
);
|
|
}
|