headplane/app/components/TableList.tsx

35 lines
661 B
TypeScript
Raw Normal View History

2024-12-31 10:31:50 +05:30
import type { HTMLProps } from 'react';
2025-02-04 17:21:03 -05:00
import cn from '~/utils/cn';
2024-12-31 10:30:14 +05:30
function TableList(props: HTMLProps<HTMLDivElement>) {
return (
<div
2024-12-31 10:30:14 +05:30
{...props}
2025-02-04 17:21:03 -05:00
className={cn(
2025-02-04 11:42:57 -05:00
'rounded-xl',
'border border-headplane-100 dark:border-headplane-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}
2025-02-04 17:21:03 -05:00
className={cn(
2025-02-04 11:42:57 -05:00
'flex items-center justify-between p-2 last:border-b-0',
'border-b border-headplane-100 dark:border-headplane-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 });