import { html, nothing } from "lit"; export interface TableProps { border: boolean; compact: boolean; responsiveStack: boolean; scrollable: boolean; sortable: boolean; stickyHeaders: boolean; striped: boolean; } const LONG_CELL_CONTENT = "Vestibulum tristique, dui ut facilisis mattis, sem elit egestas magna, pretium accumsan sapien urna et nulla."; const SHORT_CELL_CONTENT = "Habitasse platea"; export const Table = ({ border, compact, responsiveStack, scrollable, sortable, stickyHeaders, striped, }: TableProps) => { const isBorderless = border === false ? "usa-table--borderless" : ""; const isCompact = compact === true ? "usa-table--compact" : ""; const isStriped = striped === true ? "usa-table--striped" : ""; const isSticky = stickyHeaders === true ? "usa-table--sticky-header" : ""; const isResponsive = responsiveStack === true ? "usa-table--stacked" : ""; const tableCellContent = scrollable === true ? LONG_CELL_CONTENT : SHORT_CELL_CONTENT; const stickyHeaderHtml = html`
| Maecenas tempor | Condimentum sodales | Tortor nec eros | Nec eros tortor |
|---|---|---|---|
| Pellen tesque fermentum | ${tableCellContent} | Tabitasse platea | Habi tasse platea |
| Lacinia imperdiet | ${tableCellContent} | Papa habitasse | Hagnis bitasse platea |
| Imperdiet lacinia | ${tableCellContent} | Sum habitasse | Incid tasse pl atea |
| Imperdiet lacinia | ${tableCellContent} | Lipsum hab itasse | Dolor tasse platea |