update ui to seats

This commit is contained in:
2026-01-26 16:15:54 -03:00
parent 5e81a67f94
commit 8dfb54c64c

View File

@@ -7,6 +7,7 @@ import {
HelpCircleIcon, HelpCircleIcon,
type LucideIcon type LucideIcon
} from 'lucide-react' } from 'lucide-react'
import { Fragment } from 'react'
import { Abbr } from '@repo/ui/components/abbr' import { Abbr } from '@repo/ui/components/abbr'
import { DateTime } from '@repo/ui/components/datetime' import { DateTime } from '@repo/ui/components/datetime'
@@ -26,6 +27,7 @@ import {
HoverCardContent, HoverCardContent,
HoverCardTrigger HoverCardTrigger
} from '@repo/ui/components/ui/hover-card' } from '@repo/ui/components/ui/hover-card'
import { Kbd } from '@repo/ui/components/ui/kbd'
import { import {
Popover, Popover,
PopoverContent, PopoverContent,
@@ -160,7 +162,7 @@ const reasons: Record<string, string> = {
DEDUPLICATION: 'Matrícula ou agendamento já existentes.', DEDUPLICATION: 'Matrícula ou agendamento já existentes.',
CANCELLATION: 'Cancelamento da matrícula.', CANCELLATION: 'Cancelamento da matrícula.',
UNSCHEDULED: 'Cancelamento do agendamento da matrícula.', UNSCHEDULED: 'Cancelamento do agendamento da matrícula.',
DEADLINE: 'Data do agendamento é anterior ao dia atual.' DEADLINE: 'Data do agendamento é anterior ao dia do pagamento.'
} as const } as const
const reason = (reason_: string): string | null => { const reason = (reason_: string): string | null => {
@@ -221,7 +223,7 @@ function SeatsMenu({ seats: seats_ }: { seats: Seat[] }) {
<EllipsisIcon /> <EllipsisIcon />
</Button> </Button>
</PopoverTrigger> </PopoverTrigger>
<PopoverContent align="end" className="w-82 "> <PopoverContent align="end" className="w-82">
<div className="grid gap-4"> <div className="grid gap-4">
{seats.length > 0 ? ( {seats.length > 0 ? (
<> <>
@@ -232,15 +234,18 @@ function SeatsMenu({ seats: seats_ }: { seats: Seat[] }) {
</p> </p>
</div> </div>
<ul className="text-sm space-y-1.5"> <div className="text-sm grid grid-cols-[1fr_15%] gap-1">
{seats.map(({ course, quantity }, idx) => { {seats.map(({ course, quantity }, idx) => {
return ( return (
<li key={idx}> <Fragment key={idx}>
{quantity}x {course.name} <Abbr>{course.name}</Abbr>
</li> <div className="flex justify-end">
<Kbd>{quantity}x</Kbd>
</div>
</Fragment>
) )
})} })}
</ul> </div>
</> </>
) : ( ) : (
<p className="text-sm text-muted-foreground"> <p className="text-sm text-muted-foreground">