This commit is contained in:
2026-01-26 18:37:34 -03:00
parent 63c6344821
commit d28b1362e5
5 changed files with 47 additions and 7 deletions

View File

@@ -5,6 +5,7 @@ import {
BookSearchIcon,
CircleCheckBigIcon,
MegaphoneIcon,
PlusIcon,
WalletIcon
} from 'lucide-react'
import { use, useEffect, useState } from 'react'
@@ -177,7 +178,9 @@ export default function Route({
</ItemContent>
<ItemActions>
<Button size="sm" asChild>
<Link to="../enrollments/seats">Matricular agora</Link>
<Link to="../enrollments/seats">
<PlusIcon /> Matricular
</Link>
</Button>
</ItemActions>
</Item>

View File

@@ -10,8 +10,20 @@ import {
BreadcrumbPage,
BreadcrumbSeparator
} from '@repo/ui/components/ui/breadcrumb'
import { request as req } from '@repo/util/request'
export default function Route({}: Route.ComponentProps) {
export async function loader({ request, params, context }: Route.LoaderArgs) {
const seats = await req({
url: `/orgs/${params.orgid}/seats`,
request,
context
}).then((r) => r.json() as any)
return { seats }
}
export default function Route({ loaderData: { seats } }: Route.ComponentProps) {
console.log(seats)
return (
<div className="space-y-2.5">
<Breadcrumb>

View File

@@ -5,6 +5,7 @@ import {
ClockIcon,
EllipsisIcon,
HelpCircleIcon,
PlusIcon,
type LucideIcon
} from 'lucide-react'
import { Fragment } from 'react'
@@ -42,6 +43,7 @@ import {
TableRow
} from '@repo/ui/components/ui/table'
import { cn, initials } from '@repo/ui/lib/utils'
import { Link } from 'react-router'
import type { Enrollment, Seat } from './route'
const dtOptions: Intl.DateTimeFormatOptions = {
@@ -151,6 +153,14 @@ export function Enrollments({
)
}
)}
{enrollments.length === 0 && (
<TableRow>
<TableCell className="text-center h-24" colSpan={5}>
Nenhuma matrícula ainda.
</TableCell>
</TableRow>
)}
</TableBody>
</Table>
</CardContent>
@@ -219,7 +229,17 @@ function SeatsMenu({ seats: seats_ }: { seats: Seat[] }) {
return (
<Popover>
<PopoverTrigger asChild>
<Button variant="ghost" size="icon-sm" className="cursor-pointer">
<Button
variant="secondary"
size="icon-sm"
className="cursor-pointer relative"
>
{seats.length > 0 && (
<span className="absolute flex size-2 -top-0.5 -right-0.5">
<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-green-400 opacity-75"></span>
<span className="relative inline-flex size-2 rounded-full bg-green-500"></span>
</span>
)}
<EllipsisIcon />
</Button>
</PopoverTrigger>
@@ -246,6 +266,12 @@ function SeatsMenu({ seats: seats_ }: { seats: Seat[] }) {
)
})}
</div>
<Button size="sm" variant="outline" asChild>
<Link to="../enrollments/seats">
<PlusIcon /> Matricular
</Link>
</Button>
</>
) : (
<p className="text-sm text-muted-foreground">

View File

@@ -386,9 +386,7 @@ export default function Route({ loaderData: { order } }: Route.ComponentProps) {
</CardContent>
</Card>
{enrollments.length > 0 ? (
<Enrollments enrollments={enrollments} seats={seats} />
) : null}
</div>
)
}
@@ -615,7 +613,7 @@ function PaymentAttemptsMenu({
return (
<Popover>
<PopoverTrigger asChild>
<Button variant="ghost" className="cursor-pointer" size="icon-sm">
<Button variant="secondary" className="cursor-pointer" size="icon-sm">
<EllipsisIcon />
</Button>
</PopoverTrigger>

View File

@@ -81,6 +81,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: events.payments.create_invoice.lambda_handler
Timeout: 12
LoggingConfig:
LogGroup: !Ref EventLog
Policies: