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

@@ -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} />
)
}
]

View File

@@ -8,7 +8,7 @@ import { DataTable } from '@repo/ui/components/data-table'
import { Skeleton } from '@repo/ui/components/skeleton'
import { createSearch } from '@repo/util/meili'
import { columns, type Order } from './columns'
import { columns, type Order } from '@repo/ui/routes/orders/columns'
export function meta({}: Route.MetaArgs) {
return [{ title: 'Histórico de compras' }]