add orders to saladeaula
This commit is contained in:
@@ -9,7 +9,7 @@ export default [
|
||||
layout('routes/layout.tsx', [
|
||||
index('routes/index.tsx'),
|
||||
route('certs', 'routes/certs.tsx'),
|
||||
route('orders', 'routes/orders/route.tsx'),
|
||||
route('orders', 'routes/orders.tsx'),
|
||||
route('settings', 'routes/settings.tsx'),
|
||||
route('konviva', 'routes/konviva.ts'),
|
||||
route('player/:id', 'routes/player.tsx'),
|
||||
|
||||
@@ -17,9 +17,9 @@ import {
|
||||
import { createSearch } from '@repo/util/meili'
|
||||
import { Skeleton } from '@repo/ui/components/skeleton'
|
||||
import { DataTable } from '@repo/ui/components/data-table'
|
||||
import { columns, type Order } from '@repo/ui/routes/orders/columns'
|
||||
|
||||
import { Container } from '@/components/container'
|
||||
import { columns, type Order } from './columns'
|
||||
|
||||
export function meta({}: Route.MetaArgs) {
|
||||
return [{ title: 'Histórico de compras' }]
|
||||
@@ -1,63 +0,0 @@
|
||||
'use client'
|
||||
|
||||
import {
|
||||
DataTableColumnDatetime,
|
||||
DataTableColumnCurrency,
|
||||
DataTableColumnHeader
|
||||
} from '@repo/ui/components/data-table'
|
||||
import { type ColumnDef } from '@tanstack/react-table'
|
||||
|
||||
// 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' | 'processing' | 'success' | 'failed'
|
||||
payment_method: 'PIX' | 'CREDIT_CARD' | 'MANUAL' | 'failed'
|
||||
name: string
|
||||
}
|
||||
|
||||
export const columns: ColumnDef<Order>[] = [
|
||||
{
|
||||
accessorKey: 'payment_method',
|
||||
header: 'Forma de pag.'
|
||||
},
|
||||
{
|
||||
accessorKey: 'status',
|
||||
header: 'Status'
|
||||
},
|
||||
{
|
||||
accessorKey: 'total',
|
||||
header: 'Valor total',
|
||||
cell: ({ row, column }) => (
|
||||
<DataTableColumnCurrency row={row} column={column} />
|
||||
)
|
||||
},
|
||||
{
|
||||
accessorKey: 'create_date',
|
||||
enableSorting: true,
|
||||
meta: { title: 'Comprado em' },
|
||||
header: ({ column }) => <DataTableColumnHeader column={column} />,
|
||||
cell: ({ row, column }) => (
|
||||
<DataTableColumnDatetime row={row} column={column} />
|
||||
)
|
||||
},
|
||||
{
|
||||
accessorKey: 'due_date',
|
||||
enableSorting: true,
|
||||
meta: { title: 'Vencimento em' },
|
||||
header: ({ column }) => <DataTableColumnHeader column={column} />,
|
||||
cell: ({ row, column }) => (
|
||||
<DataTableColumnDatetime row={row} column={column} />
|
||||
)
|
||||
},
|
||||
{
|
||||
accessorKey: 'payment_date',
|
||||
enableSorting: true,
|
||||
meta: { title: 'Pago em' },
|
||||
header: ({ column }) => <DataTableColumnHeader column={column} />,
|
||||
cell: ({ row, column }) => (
|
||||
<DataTableColumnDatetime row={row} column={column} />
|
||||
)
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user