frigate/web/src/components/Table.jsx

32 lines
963 B
React
Raw Normal View History

2021-01-09 20:26:46 +03:00
import { h } from 'preact';
export function Table({ children, className }) {
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
}
export function Thead({ children, className }) {
return <thead className={`${className}`}>{children}</thead>;
2021-01-09 20:26:46 +03:00
}
export function Tbody({ children, className }) {
return <tbody className={`${className}`}>{children}</tbody>;
2021-01-09 20:26:46 +03:00
}
export function Tfoot({ children, className }) {
return <tfoot className={`${className}`}>{children}</tfoot>;
2021-01-09 20:26:46 +03:00
}
export function Tr({ children, className, index }) {
return <tr className={`${index % 2 ? 'bg-gray-200 ' : ''} ${className}`}>{children}</tr>;
2021-01-09 20:26:46 +03:00
}
export function Th({ children, className }) {
return <th className={`border-b-2 border-gray-400 p-4 text-left ${className}`}>{children}</th>;
2021-01-09 20:26:46 +03:00
}
export function Td({ children, className }) {
return <td className={`p-4 ${className}`}>{children}</td>;
2021-01-09 20:26:46 +03:00
}