import { jsx as _jsx } from "react/jsx-runtime";
import { FormMessageList } from '../../../scalars/components/fragments/form-message/message-list.js';
import { Icon } from '../../../ui/components/icon/icon.js';
import { Tooltip, TooltipProvider } from '../../../ui/components/tooltip/tooltip.js';
import { useInternalTableState } from '../table-provider/table-provider.js';
import { TableCellBasic } from './basic-cell.js';
const InformationCell = ({ rowIndex }) => {
    const { state: { selectedCellIndex, selectedRowErrors }, } = useInternalTableState();
    return (_jsx(TableCellBasic, { className: "min-w-[40px] max-w-[40px] [&_div]:justify-center", children: _jsx("div", { className: "flex items-center justify-center h-full w-full", children: selectedCellIndex?.row === rowIndex && Array.isArray(selectedRowErrors) && selectedRowErrors.length > 0 && (_jsx(TooltipProvider, { children: _jsx(Tooltip, { content: _jsx(FormMessageList, { messages: selectedRowErrors, type: "error" }), align: "end", side: "bottom", children: _jsx(Icon, { name: "Error", size: 16, className: "text-red-900" }) }) })) }) }));
};
export { InformationCell };
//# sourceMappingURL=information-cell.js.map