"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TableContainer = TableContainer;
exports.Table = Table;
exports.TableHeader = TableHeader;
exports.TableBody = TableBody;
exports.TableFooter = TableFooter;
exports.TableHead = TableHead;
exports.TableRow = TableRow;
exports.TableCell = TableCell;
exports.TableCellWrapper = TableCellWrapper;
exports.TableCellAction = TableCellAction;
exports.TableCaption = TableCaption;
const jsx_runtime_1 = require("react/jsx-runtime");
const utils_1 = require("../../../lib/utils");
function TableContainer({ className, ...props }) {
    return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "data-table-container", className: (0, utils_1.cn)('mt-4', className), ...props }));
}
function Table({ className, ...props }) {
    return ((0, jsx_runtime_1.jsx)("div", { className: "relative w-full overflow-auto", children: (0, jsx_runtime_1.jsx)("table", { "data-slot": "data-table", className: (0, utils_1.cn)('w-full caption-bottom text-sm', className), ...props }) }));
}
function TableHeader({ className, ...props }) {
    return ((0, jsx_runtime_1.jsx)("thead", { "data-slot": "data-table-header", className: (0, utils_1.cn)('[&_tr]:border-b hover:[&_tr]:bg-transparent', className), ...props }));
}
function TableBody({ className, ...props }) {
    return ((0, jsx_runtime_1.jsx)("tbody", { "data-slot": "data-table-body", className: (0, utils_1.cn)('', className), ...props }));
}
function TableFooter({ className, ...props }) {
    return ((0, jsx_runtime_1.jsx)("tfoot", { "data-slot": "data-table-footer", className: (0, utils_1.cn)('bg-muted/50 border-t font-medium last:[&>tr]:border-b-0', className), ...props }));
}
function TableRow({ className, active, button, ...props }) {
    return ((0, jsx_runtime_1.jsx)("tr", { "data-slot": "data-table-row", className: (0, utils_1.cn)('data-[state=selected]:bg-muted hover:bg-muted border-b transition-colors', {
            'cursor-pointer': button,
            'bg-accent/50 hover:bg-accent/50': active
        }, className), ...props }));
}
function TableHead({ className, align, ...props }) {
    return ((0, jsx_runtime_1.jsx)("th", { "data-slot": "data-table-head", className: (0, utils_1.cn)('text-muted-foreground h-12 px-6 py-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0', {
            'text-center': align === 'center',
            'text-right': align === 'right'
        }, className), ...props }));
}
function TableCell({ className, onClick, ...props }) {
    return ((0, jsx_runtime_1.jsx)("td", { "data-slot": "data-table-cell", className: (0, utils_1.cn)('group/table-cell text-foreground px-6 py-4 align-middle text-sm font-normal [&:has([role=checkbox])]:pr-0', {
            'hover:underline': onClick
        }, className), onClick: onClick, ...props }));
}
function TableCellWrapper({ className, ...props }) {
    return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "data-table-cell-wrapper", className: (0, utils_1.cn)('flex items-center', className), ...props }));
}
function TableCellAction({ className, ...props }) {
    return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "data-table-cell-action", className: (0, utils_1.cn)('ml-4 w-fit opacity-0 transition-opacity group-hover/table-cell:opacity-100', className), ...props }));
}
function TableCaption({ className, ...props }) {
    return ((0, jsx_runtime_1.jsx)("caption", { "data-slot": "data-table-caption", className: (0, utils_1.cn)('text-muted-foreground mt-4 text-sm', className), ...props }));
}
