"use client"; import { useState } from "react"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { Label } from "@/components/ui/label"; import { Select } from "@/components/ui/select"; import { Checkbox } from "@/components/ui/checkbox"; import { Input } from "@/components/ui/input"; import { Eye } from "lucide-react"; import { REPORT_TYPES, type ReportType } from "@/lib/pdf/reports"; export function CustomReportsForm() { const [type, setType] = useState("customer-delivery"); const [range, setRange] = useState("this-month"); const [start, setStart] = useState(""); const [end, setEnd] = useState(""); const [sort, setSort] = useState("date"); const [includePricing, setIncludePricing] = useState(true); const previewUrl = `/api/reports/preview?type=${type}&range=${range}${range === "custom" ? `&start=${start}&end=${end}` : ""}&include_pricing=${includePricing}`; return (
Build report Choose type and date range
setRange(e.target.value)} options={[ { value: "this-month", label: "This Month" }, { value: "last-month", label: "Last Month" }, { value: "custom", label: "Custom" }, ]} />
{range === "custom" && (
setStart(e.target.value)} />
setEnd(e.target.value)} />
)}