Files
saladeaula.digital/packages/ui/src/routes/orders/data.tsx
2025-11-25 08:16:34 -03:00

73 lines
1.6 KiB
TypeScript

import {
CheckCircleIcon,
ClockAlertIcon,
RotateCcwIcon,
CircleXIcon,
ClockIcon,
BanIcon,
type LucideIcon
} from 'lucide-react'
// This type is used to define the shape of our data.
// You can use a Zod schema here if you want.
export type Order = {
id: string
total: number
status: 'PENDING' | 'PAID' | 'DECLINED' | 'EXPIRED' | 'REFUNDED' | 'CANCELED'
payment_method: 'PIX' | 'CREDIT_CARD' | 'BANK_SLIP' | 'MANUAL'
name: string
email: string
}
export const statuses: Record<
string,
{ icon: LucideIcon; color?: string; label: string }
> = {
PENDING: {
icon: ClockIcon,
label: 'Pendente',
color: 'text-blue-400 [&_svg]:text-blue-500'
},
PAID: {
icon: CheckCircleIcon,
color: 'text-green-400 [&_svg]:text-green-500',
label: 'Pago'
},
DECLINED: {
icon: BanIcon,
color: 'text-red-400 [&_svg]:text-red-500',
label: 'Negado'
},
EXPIRED: {
icon: ClockAlertIcon,
color: 'text-orange-400 [&_svg]:text-orange-500',
label: 'Expirado'
},
REFUNDED: {
icon: RotateCcwIcon,
color: 'text-orange-400 [&_svg]:text-orange-500',
label: 'Estornado'
},
CANCELED: {
icon: CircleXIcon,
color: 'text-red-400 [&_svg]:text-red-500',
label: 'Cancelado'
}
}
export const labels: Record<string, string> = {
PENDING: 'Pendente',
PAID: 'Pago',
DECLINED: 'Negado',
EXPIRED: 'Expirado',
REFUNDED: 'Estornado',
CANCELED: 'Cancelado'
}
export const methods: Record<string, string> = {
PIX: 'Pix',
CREDIT_CARD: 'Cartão de crédito',
BANK_SLIP: 'Boleto bancário',
MANUAL: 'Depósito bancário'
}