import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { TBody, Table } from "@vertesia/ui/core";
import { useNavigate } from "@vertesia/ui/router";
import dayjs from "dayjs";
import relativeTime from "dayjs/plugin/relativeTime";
dayjs.extend(relativeTime);
export function ContentObjectTypesTable({ objects, isLoading }) {
    const navigate = useNavigate();
    return (_jsx("div", { children: _jsxs(Table, { className: "w-full", children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Name" }), _jsx("th", { children: "Strict Mode" }), _jsx("th", { children: "Semantic Chunking" }), _jsx("th", { children: "Updated At" })] }) }), _jsx(TBody, { isLoading: isLoading, columns: 3, children: objects?.map((obj) => (_jsxs("tr", { onClick: () => navigate(`/types/${obj.id}`), className: 'cursor-pointer hover:bg-muted', children: [_jsx("td", { children: obj.name }), _jsx("td", { children: obj.strict_mode ? 'Yes' : 'No' }), _jsx("td", { children: obj.is_chunkable ? 'Yes' : 'No' }), _jsx("td", { children: dayjs(obj.updated_at).fromNow() })] }, obj.id))) })] }) }));
}
//# sourceMappingURL=ContentObjectTypesTable.js.map