"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = SortItem;
const tslib_1 = require("tslib");
const image_1 = tslib_1.__importDefault(require("next/image"));
const react_1 = tslib_1.__importDefault(require("react"));
const icon_1 = require("../../assets/icon");
const Dropdown_1 = require("../Dropdown");
const types_1 = require("../types");
function SortItem({ children, title, subTitle, content, actions, enableBorder = false, className, originActionDropdown = 'left', dragIconPosition = 'left', }) {
    const border = 'shadow-xs rounded-lg bg-white border border-gray-200';
    const dragIcon = (react_1.default.createElement("div", { className: 'h-5 w-5 flex-shrink-0' },
        react_1.default.createElement(image_1.default, { alt: 'drag', height: 20, src: icon_1.PHXIcons.DRAG, width: 20 })));
    return (react_1.default.createElement("div", { className: (0, types_1.classNames)(enableBorder ? border : '', 'drag-item cursor-move p-4', className) },
        react_1.default.createElement("div", { className: 'flex flex-col justify-center' },
            react_1.default.createElement("div", { className: 'flex justify-between items-center gap-2' },
                react_1.default.createElement("div", { className: 'flex items-center gap-2 flex-1 min-w-0' },
                    dragIconPosition === 'left' && dragIcon,
                    react_1.default.createElement("div", { className: 'flex flex-col gap-1 min-w-0 flex-1 ' },
                        react_1.default.createElement("div", { className: 'flex items-start gap-1 flex-wrap' },
                            typeof title === 'string' ? (react_1.default.createElement("div", { className: 'max-w-lg text-sm font-semibold text-gray-800' }, title)) : (react_1.default.createElement("div", { className: 'break-all text-xs font-semibold text-gray-800' }, title)),
                            !!subTitle && react_1.default.createElement("div", { className: 'flex-shrink-0' }, subTitle)))),
                !!(actions === null || actions === void 0 ? void 0 : actions.length) && (react_1.default.createElement("div", { className: 'flex items-center gap-2 flex-shrink-0' },
                    react_1.default.createElement(Dropdown_1.PHXDropdown, { options: actions, type: 'ellipsis-icon', origin: originActionDropdown }))),
                dragIconPosition === 'right' && dragIcon),
            !!content &&
                (typeof content === 'string' ? react_1.default.createElement("div", { className: 'mt-2 text-sm ml-7 text-gray-600' }, content) : content)),
        children));
}
//# sourceMappingURL=SortItem.js.map