import Image from 'next/image';
import React from 'react';
import { PHXIcons } from '../../assets/icon';
import { PHXDropdown } from '../Dropdown';
import { classNames } from '../types';
export default 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.createElement("div", { className: 'h-5 w-5 flex-shrink-0' },
        React.createElement(Image, { alt: 'drag', height: 20, src: PHXIcons.DRAG, width: 20 })));
    return (React.createElement("div", { className: classNames(enableBorder ? border : '', 'drag-item cursor-move p-4', className) },
        React.createElement("div", { className: 'flex flex-col justify-center' },
            React.createElement("div", { className: 'flex justify-between items-center gap-2' },
                React.createElement("div", { className: 'flex items-center gap-2 flex-1 min-w-0' },
                    dragIconPosition === 'left' && dragIcon,
                    React.createElement("div", { className: 'flex flex-col gap-1 min-w-0 flex-1 ' },
                        React.createElement("div", { className: 'flex items-start gap-1 flex-wrap' },
                            typeof title === 'string' ? (React.createElement("div", { className: 'max-w-lg text-sm font-semibold text-gray-800' }, title)) : (React.createElement("div", { className: 'break-all text-xs font-semibold text-gray-800' }, title)),
                            !!subTitle && React.createElement("div", { className: 'flex-shrink-0' }, subTitle)))),
                !!(actions === null || actions === void 0 ? void 0 : actions.length) && (React.createElement("div", { className: 'flex items-center gap-2 flex-shrink-0' },
                    React.createElement(PHXDropdown, { options: actions, type: 'ellipsis-icon', origin: originActionDropdown }))),
                dragIconPosition === 'right' && dragIcon),
            !!content &&
                (typeof content === 'string' ? React.createElement("div", { className: 'mt-2 text-sm ml-7 text-gray-600' }, content) : content)),
        children));
}
//# sourceMappingURL=SortItem.js.map