update
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
|||||||
BookSearchIcon,
|
BookSearchIcon,
|
||||||
CircleCheckBigIcon,
|
CircleCheckBigIcon,
|
||||||
MegaphoneIcon,
|
MegaphoneIcon,
|
||||||
|
PlusIcon,
|
||||||
WalletIcon
|
WalletIcon
|
||||||
} from 'lucide-react'
|
} from 'lucide-react'
|
||||||
import { use, useEffect, useState } from 'react'
|
import { use, useEffect, useState } from 'react'
|
||||||
@@ -177,7 +178,9 @@ export default function Route({
|
|||||||
</ItemContent>
|
</ItemContent>
|
||||||
<ItemActions>
|
<ItemActions>
|
||||||
<Button size="sm" asChild>
|
<Button size="sm" asChild>
|
||||||
<Link to="../enrollments/seats">Matricular agora</Link>
|
<Link to="../enrollments/seats">
|
||||||
|
<PlusIcon /> Matricular
|
||||||
|
</Link>
|
||||||
</Button>
|
</Button>
|
||||||
</ItemActions>
|
</ItemActions>
|
||||||
</Item>
|
</Item>
|
||||||
|
|||||||
@@ -10,8 +10,20 @@ import {
|
|||||||
BreadcrumbPage,
|
BreadcrumbPage,
|
||||||
BreadcrumbSeparator
|
BreadcrumbSeparator
|
||||||
} from '@repo/ui/components/ui/breadcrumb'
|
} 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 (
|
return (
|
||||||
<div className="space-y-2.5">
|
<div className="space-y-2.5">
|
||||||
<Breadcrumb>
|
<Breadcrumb>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
ClockIcon,
|
ClockIcon,
|
||||||
EllipsisIcon,
|
EllipsisIcon,
|
||||||
HelpCircleIcon,
|
HelpCircleIcon,
|
||||||
|
PlusIcon,
|
||||||
type LucideIcon
|
type LucideIcon
|
||||||
} from 'lucide-react'
|
} from 'lucide-react'
|
||||||
import { Fragment } from 'react'
|
import { Fragment } from 'react'
|
||||||
@@ -42,6 +43,7 @@ import {
|
|||||||
TableRow
|
TableRow
|
||||||
} from '@repo/ui/components/ui/table'
|
} from '@repo/ui/components/ui/table'
|
||||||
import { cn, initials } from '@repo/ui/lib/utils'
|
import { cn, initials } from '@repo/ui/lib/utils'
|
||||||
|
import { Link } from 'react-router'
|
||||||
import type { Enrollment, Seat } from './route'
|
import type { Enrollment, Seat } from './route'
|
||||||
|
|
||||||
const dtOptions: Intl.DateTimeFormatOptions = {
|
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>
|
</TableBody>
|
||||||
</Table>
|
</Table>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
@@ -219,7 +229,17 @@ function SeatsMenu({ seats: seats_ }: { seats: Seat[] }) {
|
|||||||
return (
|
return (
|
||||||
<Popover>
|
<Popover>
|
||||||
<PopoverTrigger asChild>
|
<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 />
|
<EllipsisIcon />
|
||||||
</Button>
|
</Button>
|
||||||
</PopoverTrigger>
|
</PopoverTrigger>
|
||||||
@@ -246,6 +266,12 @@ function SeatsMenu({ seats: seats_ }: { seats: Seat[] }) {
|
|||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<Button size="sm" variant="outline" asChild>
|
||||||
|
<Link to="../enrollments/seats">
|
||||||
|
<PlusIcon /> Matricular
|
||||||
|
</Link>
|
||||||
|
</Button>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<p className="text-sm text-muted-foreground">
|
<p className="text-sm text-muted-foreground">
|
||||||
@@ -386,9 +386,7 @@ export default function Route({ loaderData: { order } }: Route.ComponentProps) {
|
|||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
{enrollments.length > 0 ? (
|
<Enrollments enrollments={enrollments} seats={seats} />
|
||||||
<Enrollments enrollments={enrollments} seats={seats} />
|
|
||||||
) : null}
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -615,7 +613,7 @@ function PaymentAttemptsMenu({
|
|||||||
return (
|
return (
|
||||||
<Popover>
|
<Popover>
|
||||||
<PopoverTrigger asChild>
|
<PopoverTrigger asChild>
|
||||||
<Button variant="ghost" className="cursor-pointer" size="icon-sm">
|
<Button variant="secondary" className="cursor-pointer" size="icon-sm">
|
||||||
<EllipsisIcon />
|
<EllipsisIcon />
|
||||||
</Button>
|
</Button>
|
||||||
</PopoverTrigger>
|
</PopoverTrigger>
|
||||||
@@ -81,6 +81,7 @@ Resources:
|
|||||||
Type: AWS::Serverless::Function
|
Type: AWS::Serverless::Function
|
||||||
Properties:
|
Properties:
|
||||||
Handler: events.payments.create_invoice.lambda_handler
|
Handler: events.payments.create_invoice.lambda_handler
|
||||||
|
Timeout: 12
|
||||||
LoggingConfig:
|
LoggingConfig:
|
||||||
LogGroup: !Ref EventLog
|
LogGroup: !Ref EventLog
|
||||||
Policies:
|
Policies:
|
||||||
|
|||||||
Reference in New Issue
Block a user