"use client"; import React from "react"; import { Cell } from "./Cell"; import TableContext from "./TableContext"; import type { TableHeader } from "./types"; interface SortOptions { none: string; ascending: string; descending: string; } const Header: React.FC = () => { const { headers, expandableRows } = React.useContext(TableContext); const sortOptions: SortOptions = { none: `zoradiť vzostupne podľa`, ascending: `zoradiť zostupne podľa`, descending: `vypnúť zoradenie poďľa`, }; return ( {headers.map((header: TableHeader, i: number) => { const { isSortable, sort = "none", label, cellProps, headCellProps, } = header; return ( {label} {isSortable && ( <> {" "} )} ); })} {expandableRows?.hasExpandableRows && ( {expandableRows?.expandableRowsCaptions?.header} )} ); }; Header.displayName = "TableHeader"; export { Header };