Labels Table
A client-side paginated table of label packs with search, point and status filters, and activate or deactivate actions.
Página 1 de 3
0 de 28 seleccionados
Items por página
Página 1 de 3
Installation
pnpm dlx shadcn@latest add @ecodeliver/labels-tableInstalling this item also copies paginated-table.tsx and pudo-selector.tsx.
Usage
Pass the full labels array. Search, point, and status filters are owned inside the component. Wire onDeactivate and onActivate for the row actions.
import { LabelsTable } from "@/components/registry/labels-table";
import { labelTableRows } from "@/mocks";
export function Example() {
return (
<LabelsTable
labels={labelTableRows}
onDeactivate={(id) => {
// open confirm dialog for id
}}
onActivate={(id) => {
// open confirm dialog for id
}}
/>
);
}Display
- Rango:
rangeFrom - rangeTo - Parcel Shop:
pudo.nameandpudo.lineAddress1 - Uso: percent and
used/500(pack size is always 500) - Estado: Activo, Consumido, or Desactivado
- Última modificación:
updatedAtasdd/MM/yy - Código postal:
pudo.postalCode - Actions: Desactivar etiquetas on active rows, Activar etiquetas on disabled rows. Consumed rows show a disabled Desactivar etiquetas button
Filters (UI labels in Spanish): search by etiqueta or postal code, Punto, Estado (Activas, Consumidas, Desactivadas). Filtering and pagination are client-side.
API Reference
LabelsTable
| Prop | Type | Default |
|---|---|---|
labels | LabelTableRow[] | - |
onDeactivate | (id: string) => void | - |
onActivate | (id: string) => void | - |
isPending | boolean | false |
LabelTableRow
| Prop | Type | Default |
|---|---|---|
id | string | - |
rangeFrom | string | - |
rangeTo | string | - |
status | "active" | "consumed" | "disabled" | - |
updatedAt | string | - |
used | number | - |
pudo | PudoPoint | - |