"use client"

import type { ITableProps } from "./Table.d"
import type { JSX } from "react"

import { Table as RadixTable } from "@radix-ui/themes"
import { forwardRef } from "react"

export const Table = forwardRef<HTMLTableElement, ITableProps>(
	({ children, ...props }, ref): JSX.Element => (
		<RadixTable.Root ref={ref} {...props}>
			{children}
		</RadixTable.Root>
	),
)

Table.displayName = "Table"

export const TableHeader = RadixTable.Header
export const TableBody = RadixTable.Body
export const TableRow = RadixTable.Row
export const TableCell = RadixTable.Cell
export const TableColumnHeaderCell = RadixTable.ColumnHeaderCell
export const TableRowHeaderCell = RadixTable.RowHeaderCell
