headplane/app/components/TableList.tsx

37 lines
714 B
TypeScript
Raw Normal View History

2024-12-31 10:30:14 +05:30
import clsx from 'clsx';
2024-12-31 10:31:50 +05:30
import type { HTMLProps } from 'react';
2024-12-31 10:30:14 +05:30
function TableList(props: HTMLProps<HTMLDivElement>) {
return (
<div
2024-12-31 10:30:14 +05:30
{...props}
className={clsx(
'border border-gray-300 rounded-lg overflow-clip',
'dark:border-zinc-700 dark:text-gray-300',
// 'dark:bg-zinc-800',
2024-12-31 10:30:14 +05:30
props.className,
)}
>
2024-12-31 10:30:14 +05:30
{props.children}
</div>
2024-12-31 10:30:14 +05:30
);
}
2024-12-31 10:30:14 +05:30
function Item(props: HTMLProps<HTMLDivElement>) {
return (
<div
2024-12-31 10:30:14 +05:30
{...props}
className={clsx(
'flex items-center justify-between px-3 py-2',
'border-b border-gray-200 last:border-b-0',
'dark:border-zinc-800',
2024-12-31 10:30:14 +05:30
props.className,
)}
>
2024-12-31 10:30:14 +05:30
{props.children}
</div>
2024-12-31 10:30:14 +05:30
);
}
2024-12-31 10:30:14 +05:30
export default Object.assign(TableList, { Item });