2021-01-09 20:26:46 +03:00
|
|
|
import { h } from 'preact';
|
|
|
|
|
|
2021-01-19 19:44:18 +03:00
|
|
|
export function Table({ children, className = '' }) {
|
2021-01-18 21:49:00 +03:00
|
|
|
return (
|
|
|
|
|
<table className={`table-auto border-collapse text-gray-900 dark:text-gray-200 ${className}`}>{children}</table>
|
|
|
|
|
);
|
2021-01-09 20:26:46 +03:00
|
|
|
}
|
|
|
|
|
|
2021-02-14 21:47:59 +03:00
|
|
|
export function Thead({ children, className, ...attrs }) {
|
|
|
|
|
return (
|
|
|
|
|
<thead className={className} {...attrs}>
|
|
|
|
|
{children}
|
|
|
|
|
</thead>
|
|
|
|
|
);
|
2021-01-09 20:26:46 +03:00
|
|
|
}
|
|
|
|
|
|
2021-09-03 15:11:23 +03:00
|
|
|
export function Tbody({ children, className, reference, ...attrs }) {
|
2021-02-14 21:47:59 +03:00
|
|
|
return (
|
2021-09-03 15:11:23 +03:00
|
|
|
<tbody ref={reference} className={className} {...attrs}>
|
2021-02-14 21:47:59 +03:00
|
|
|
{children}
|
|
|
|
|
</tbody>
|
|
|
|
|
);
|
2021-01-09 20:26:46 +03:00
|
|
|
}
|
|
|
|
|
|
2021-02-14 21:47:59 +03:00
|
|
|
export function Tfoot({ children, className = '', ...attrs }) {
|
|
|
|
|
return (
|
|
|
|
|
<tfoot className={`${className}`} {...attrs}>
|
|
|
|
|
{children}
|
|
|
|
|
</tfoot>
|
|
|
|
|
);
|
2021-01-09 20:26:46 +03:00
|
|
|
}
|
|
|
|
|
|
2021-09-03 15:11:23 +03:00
|
|
|
export function Tr({ children, className = '', reference, ...attrs }) {
|
2021-02-05 03:18:15 +03:00
|
|
|
return (
|
|
|
|
|
<tr
|
2021-09-03 15:11:23 +03:00
|
|
|
ref={reference}
|
2021-02-05 03:18:15 +03:00
|
|
|
className={`border-b border-gray-200 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-800 ${className}`}
|
2021-02-14 21:47:59 +03:00
|
|
|
{...attrs}
|
2021-02-05 03:18:15 +03:00
|
|
|
>
|
|
|
|
|
{children}
|
|
|
|
|
</tr>
|
|
|
|
|
);
|
2021-01-09 20:26:46 +03:00
|
|
|
}
|
|
|
|
|
|
2021-02-14 21:47:59 +03:00
|
|
|
export function Th({ children, className = '', colspan, ...attrs }) {
|
2021-01-26 18:04:03 +03:00
|
|
|
return (
|
2021-02-14 21:47:59 +03:00
|
|
|
<th className={`border-b border-gray-400 p-2 px-1 lg:p-4 text-left ${className}`} colSpan={colspan} {...attrs}>
|
2021-01-26 18:04:03 +03:00
|
|
|
{children}
|
|
|
|
|
</th>
|
|
|
|
|
);
|
2021-01-09 20:26:46 +03:00
|
|
|
}
|
|
|
|
|
|
2021-09-03 15:11:23 +03:00
|
|
|
export function Td({ children, className = '', reference, colspan, ...attrs }) {
|
2021-01-26 18:04:03 +03:00
|
|
|
return (
|
2021-09-03 15:11:23 +03:00
|
|
|
<td ref={reference} className={`p-2 px-1 lg:p-4 ${className}`} colSpan={colspan} {...attrs}>
|
2021-01-26 18:04:03 +03:00
|
|
|
{children}
|
|
|
|
|
</td>
|
|
|
|
|
);
|
2021-01-09 20:26:46 +03:00
|
|
|
}
|