{% load brickwork_components brickwork_icons i18n %} {% comment %} Data table: STRUCTURE ONLY (BR-BW-TPL-005, never virtualisation/AG-Grid). It renders columns with server-side sortable headers, rows with STABLE per-row ids (BR-BW-HTMX-005, so a consumer's hx-target can address a row), an empty state at exactly zero rows (STA-001), and a loading skeleton (STA-004). Sort/filter/ paginate are server-driven: the view computes the order and passes the current sort; a header link carries the sort param, no client-side sorting. Two shapes, selected by ``variant``: - ``variant="records"`` (default): a columnar table of same-shaped records. columns: a list of dicts: {label, sortable(bool), sort_key(str)}. For a SORTABLE column supply ``sortable=True`` and ``sort_key`` (the base ascending order key, e.g. "name"); the template derives the descending key ("-name") and the next-click toggle itself from ``sort_key`` + the shared ``current_sort``, so a consumer does NOT compute ``sort_key_desc`` / ``next_sort`` (#23). Those two keys may still be passed to override the convention, but are optional. rows: a list of dicts: {id, cells: [rendered strings], url(optional), selected(optional bool)} A row with a ``url`` becomes a clickable row: its first cell is an anchor to ``url`` (the whole row is keyboard-reachable via that link), so a documented per-row link actually renders (#10). A row with truthy ``selected`` carries the ``bw-data-table__row--selected`` class (the selected-row styling hook, e.g. the row a bulk action or detail pane refers to). - ``variant="definition"``: a key/value fact table for ONE entity (a detail screen's "facts about this thing", the