share route itens

This commit is contained in:
2025-11-24 19:11:20 -03:00
parent 4db2123bc5
commit 21840506b0
31 changed files with 460 additions and 703 deletions

View File

@@ -24,8 +24,7 @@ import {
import { Progress } from '@repo/ui/components/ui/progress'
import { Spinner } from '@repo/ui/components/ui/spinner'
import { cn, initials } from '@repo/ui/lib/utils'
import { labels, statuses } from './data'
import { labels, statuses } from '@repo/ui/routes/enrollments/data'
// This type is used to define the shape of our data.
// You can use a Zod schema here if you want.

View File

@@ -1,69 +0,0 @@
import {
CircleCheckIcon,
CircleIcon,
CircleOffIcon,
CircleXIcon,
TimerIcon,
type LucideIcon
} from 'lucide-react'
export const statuses: Record<
string,
{ icon: LucideIcon; color?: string; label: string }
> = {
PENDING: {
icon: CircleIcon,
label: 'Não iniciado'
},
IN_PROGRESS: {
icon: TimerIcon,
color: 'text-blue-400 [&_svg]:text-blue-500',
label: 'Em andamento'
},
COMPLETED: {
icon: CircleCheckIcon,
color: 'text-green-400 [&_svg]:text-background [&_svg]:fill-green-500',
label: 'Concluído'
},
FAILED: {
icon: CircleXIcon,
color: 'text-red-400 [&_svg]:text-red-500',
label: 'Reprovado'
},
CANCELED: {
icon: CircleOffIcon,
color: 'text-orange-400 [&_svg]:text-orange-500',
label: 'Cancelado'
}
}
export const labels: Record<string, string> = {
PENDING: 'Não iniciado',
IN_PROGRESS: 'Em andamento',
COMPLETED: 'Concluído',
FAILED: 'Reprovado',
CANCELED: 'Cancelado'
}
export const sortings: Record<string, string> = {
created_at: 'Cadastrado em',
started_at: 'Iniciado em',
completed_at: 'Concluído em',
failed_at: 'Reprovado em',
canceled_at: 'Cancelado em'
}
export const headers = {
id: 'ID',
'user.name': 'Nome',
'user.email': 'Email',
'user.cpf': 'CPF',
'course.name': 'Curso',
status: 'Status',
progress: 'Progresso',
created_at: 'Cadastrado em',
started_at: 'Iniciado em',
completed_at: 'Concluído em',
failed_at: 'Reprovado em',
canceled_at: 'Cancelado em'
}

View File

@@ -31,8 +31,8 @@ import {
import { Kbd } from '@repo/ui/components/ui/kbd'
import { createSearch } from '@repo/util/meili'
import { headers, sortings, statuses } from '@repo/ui/routes/enrollments/data'
import { columns, type Enrollment } from './columns'
import { headers, sortings, statuses } from './data'
export function meta({}: Route.MetaArgs) {
return [{ title: 'Matrículas' }]