feat: structure
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { type ComponentPropsWithoutRef } from 'react';
|
||||
import { cx } from '../utils';
|
||||
|
||||
export const Table = ({ children, ...props }: ComponentPropsWithoutRef<'table'>) => (
|
||||
<div className="modern-sk-table-wrap">
|
||||
<table className="modern-sk-table" {...props}>
|
||||
{children}
|
||||
</table>
|
||||
</div>
|
||||
);
|
||||
|
||||
export const THead = (p: ComponentPropsWithoutRef<'thead'>) => <thead {...p} />;
|
||||
export const TBody = (p: ComponentPropsWithoutRef<'tbody'>) => <tbody {...p} />;
|
||||
|
||||
export const Tr = ({
|
||||
selected,
|
||||
className,
|
||||
...props
|
||||
}: ComponentPropsWithoutRef<'tr'> & { selected?: boolean }) => (
|
||||
<tr className={cx(selected && 'is-selected', className)} {...props} />
|
||||
);
|
||||
|
||||
export const Th = (p: ComponentPropsWithoutRef<'th'>) => <th {...p} />;
|
||||
export const Td = (p: ComponentPropsWithoutRef<'td'>) => <td {...p} />;
|
||||
Reference in New Issue
Block a user