2024-07-12 13:01:10 -05:00
|
|
|
import { Table } from '@radix-ui/themes';
|
2024-09-23 10:49:54 -05:00
|
|
|
import type { ColumnHeaderCellProps } from '@radix-ui/themes/src/components/table.js';
|
2024-07-12 13:01:10 -05:00
|
|
|
|
2024-07-12 19:55:41 -05:00
|
|
|
interface StickyColumnHeaderCellProps extends ColumnHeaderCellProps {
|
|
|
|
|
top?: number | string;
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-12 13:01:10 -05:00
|
|
|
export function StickyColumnHeaderCell({
|
|
|
|
|
style,
|
2024-07-12 19:55:41 -05:00
|
|
|
top = 0,
|
2024-07-12 13:01:10 -05:00
|
|
|
...props
|
2024-07-12 19:55:41 -05:00
|
|
|
}: StickyColumnHeaderCellProps) {
|
2024-07-12 13:01:10 -05:00
|
|
|
return (
|
|
|
|
|
<Table.ColumnHeaderCell
|
|
|
|
|
style={{
|
|
|
|
|
position: 'sticky',
|
2024-07-12 19:55:41 -05:00
|
|
|
top,
|
2024-07-12 13:01:10 -05:00
|
|
|
background: 'var(--gray-3)',
|
|
|
|
|
zIndex: 1,
|
|
|
|
|
...style,
|
|
|
|
|
}}
|
|
|
|
|
{...props}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|