GLS Registry

Labels Table

A client-side paginated table of label packs with search, point and status filters, and activate or deactivate actions.

RangoParcel ShopUsoEstadoÚltima modificaciónCódigo postal
PS123 - PS622
Copistería Sant MartíCarrer de Independència 341
73% - 366/500
Activo01/09/2608020
PS623 - PS1122
Copistería Sant MartíCarrer de Independència 341
24% - 120/500
Activo12/08/2608020
PS1123 - PS1622
Copistería Sant MartíCarrer de Independència 341
100% - 500/500
Consumido07/05/2608020
PS1623 - PS2122
Copistería Sant MartíCarrer de Independència 341
18% - 88/500
Desactivado07/05/2608020
PS2123 - PS2622
Transportes MiróCarrer de Pallars 88
100% - 500/500
Activo01/09/2608005
PS2623 - PS3122
Transportes MiróCarrer de Pallars 88
8% - 41/500
Activo21/08/2608005
PS3123 - PS3622
Transportes MiróCarrer de Pallars 88
100% - 500/500
Consumido07/05/2608005
PS3623 - PS4122
Transportes MiróCarrer de Pallars 88
42% - 210/500
Desactivado07/05/2608005
PS4123 - PS4622
Peluquería MariCarrer de Provença 215
3% - 15/500
Activo04/09/2608008
PS4623 - PS5122
Peluquería MariCarrer de Provença 215
55% - 275/500
Activo01/08/2608008

Página 1 de 3

Installation

pnpm dlx shadcn@latest add @ecodeliver/labels-table

Installing 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.name and pudo.lineAddress1
  • Uso: percent and used/500 (pack size is always 500)
  • Estado: Activo, Consumido, or Desactivado
  • Última modificación: updatedAt as dd/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

PropTypeDefault
labelsLabelTableRow[]-
onDeactivate(id: string) => void-
onActivate(id: string) => void-
isPendingbooleanfalse

LabelTableRow

PropTypeDefault
idstring-
rangeFromstring-
rangeTostring-
status"active" | "consumed" | "disabled"-
updatedAtstring-
usednumber-
pudoPudoPoint-

On this page