import React from 'react';
import { PHXCheckbox } from '../Checkbox';
import { PHXBadge } from '../Badge';
export default function ProductTable({ data, handleCheckData, isVerifyProjectCode }) {
    return (React.createElement("table", { className: 'w-full ' },
        React.createElement("tbody", { className: 'divide-y divide-gray-200 ' }, data.map((item, productIndex) => {
            var _a;
            const { name, image, tuition_fee_type_of_service } = item;
            //mã công trình
            const projectCode = (_a = tuition_fee_type_of_service === null || tuition_fee_type_of_service === void 0 ? void 0 : tuition_fee_type_of_service.tuition_fee_project_codes) === null || _a === void 0 ? void 0 : _a[0];
            const isDisable = isVerifyProjectCode && !projectCode;
            const validImage = item.bundle_id ? image : image === null || image === void 0 ? void 0 : image[0];
            return (React.createElement(React.Fragment, { key: productIndex },
                React.createElement("tr", null,
                    React.createElement("td", { className: ' relative  whitespace-nowrap   py-3 pl-3  text-xs font-normal  rounded-lg  text-gray-800' },
                        React.createElement("div", { className: 'flex items-center' },
                            isDisable ? (React.createElement("div", { className: 'w-4 h-4  rounded-[4px] mr-3 bg-gray-200' })) : (React.createElement(PHXCheckbox, { checked: data[productIndex].checked })),
                            validImage ? (React.createElement("img", { src: validImage, className: 'object-contain w-[40px] h-[40px] -ml-1 mr-2 border rounded-lg p-1' })) : (React.createElement("div", { className: 'border rounded-lg p-1 w-[40px] h-[40px] flex justify-center items-center  mr-2' },
                                React.createElement("img", { src: 'https://sisv2-cdn.phx-smartschool.com/library/book-copy/6-19-2025/cce5c317-55b2-4d73-b523-46a6415abff8-Icon.png', className: 'w-[13px] h-[13px]' }))),
                            React.createElement("div", { className: 'w-[320px] md:w-[500px] space-y-[2px] truncate' },
                                React.createElement("p", { className: 'font-semibold truncate' }, name),
                                isVerifyProjectCode && (React.createElement(React.Fragment, null,
                                    React.createElement("p", { className: `${!projectCode ? 'pb-0.5' : ''}` },
                                        React.createElement("span", { className: 'text-gray-600' }, "D\u1ECBch v\u1EE5: "),
                                        tuition_fee_type_of_service && (React.createElement("span", { className: 'text-gray-800' }, tuition_fee_type_of_service.description))),
                                    projectCode ? (React.createElement("p", null,
                                        React.createElement("span", { className: 'text-gray-600' }, "M\u00E3 c\u00F4ng tr\u00ECnh: "),
                                        React.createElement("span", { className: 'text-gray-800' },
                                            " ",
                                            projectCode.code))) : (React.createElement(PHXBadge, { type: 'danger', text: 'Ch\u01B0a t\u1EA1o m\u00E3 c\u00F4ng tr\u00ECnh' })))))),
                        isDisable ? (React.createElement(React.Fragment, null)) : (React.createElement("button", { className: ' absolute inset-0', type: 'button', onClick: () => handleCheckData(item, productIndex) }))))));
        }))));
}
//# sourceMappingURL=product-table.js.map