diff --git a/components/contas/transfer-dialog.tsx b/components/contas/transfer-dialog.tsx index 4e601a7..b8edb30 100644 --- a/components/contas/transfer-dialog.tsx +++ b/components/contas/transfer-dialog.tsx @@ -2,8 +2,11 @@ import { transferBetweenAccountsAction } from "@/app/(dashboard)/contas/actions"; import type { AccountData } from "@/app/(dashboard)/contas/data"; +import { ContaCartaoSelectContent } from "@/components/lancamentos/select-items"; +import { PeriodPicker } from "@/components/period-picker"; import { Button } from "@/components/ui/button"; import { CurrencyInput } from "@/components/ui/currency-input"; +import { DatePicker } from "@/components/ui/date-picker"; import { Dialog, DialogContent, @@ -13,7 +16,6 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; -import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Select, @@ -23,7 +25,7 @@ import { SelectValue, } from "@/components/ui/select"; import { useControlledState } from "@/hooks/use-controlled-state"; -import { formatDateForDb } from "@/lib/utils/date"; +import { getTodayDateString } from "@/lib/utils/date"; import { useMemo, useState, useTransition } from "react"; import { toast } from "sonner"; @@ -56,7 +58,7 @@ export function TransferDialog({ // Form state const [toAccountId, setToAccountId] = useState(""); const [amount, setAmount] = useState(""); - const [date, setDate] = useState(formatDateForDb(new Date())); + const [date, setDate] = useState(getTodayDateString()); const [period, setPeriod] = useState(currentPeriod); // Available destination accounts (exclude source account) @@ -105,7 +107,7 @@ export function TransferDialog({ // Reset form setToAccountId(""); setAmount(""); - setDate(formatDateForDb(new Date())); + setDate(getTodayDateString()); setPeriod(currentPeriod); return; } @@ -130,24 +132,20 @@ export function TransferDialog({
- setDate(e.target.value)} + onChange={setDate} required />
- setPeriod(e.target.value)} - placeholder="AAAA-MM" - required + onChange={setPeriod} + className="w-full" />
@@ -164,12 +162,30 @@ export function TransferDialog({
- +
@@ -182,12 +198,30 @@ export function TransferDialog({ ) : (