Center report filter controls

This commit is contained in:
Esdras Renan 2025-11-19 09:40:39 -03:00
parent ff9d95746e
commit feac6c2bb7
2 changed files with 6 additions and 2 deletions

View file

@ -116,6 +116,8 @@ export function DateRangeButton({
setOpen(false)
}
const clearEnabled = Boolean(from || to || draftRange?.from || draftRange?.to)
return (
<Popover
open={open}
@ -156,7 +158,7 @@ export function DateRangeButton({
setOpen(false)
}}
className="inline-flex items-center gap-2 rounded-full px-3 py-1 text-sm font-medium text-neutral-600 transition hover:text-neutral-900 disabled:opacity-40"
disabled={!from && !to}
disabled={!clearEnabled}
>
<IconEraser className="size-4" />
<span>{clearLabel}</span>

View file

@ -65,7 +65,8 @@ export function ReportsFilterToolbar({
onValueChange={(next) => onCompanyChange(next ?? "all")}
options={companyOptions}
placeholder="Todas as empresas"
triggerClassName="h-10 w-full min-w-56 rounded-2xl border border-border/60 bg-background/95 px-3 text-left text-sm font-semibold text-neutral-800 md:w-64"
triggerClassName="h-10 w-full min-w-56 rounded-2xl border border-border/60 bg-background/95 px-3 text-sm font-semibold text-neutral-800 md:w-64"
align="center"
/>
{onDateRangeChange ? (
<DateRangeButton
@ -73,6 +74,7 @@ export function ReportsFilterToolbar({
to={dateTo ?? null}
onChange={onDateRangeChange}
className="w-full min-w-[200px] md:w-auto"
align="center"
/>
) : null}
{showBillingFilter ? (