import React, { forwardRef } from "react";
import { IconCloseCircleOutline } from "../../../_Icon";
import { StyledIconButtonCancel } from "../IconButton/IconButton.styles";
import { FilenameExtensionPart, FilenameWrapper, TruncatedFilenamePart } from "../../Attach.styles";
import { StyledCell } from "./Cell.styles";
export const CellUI = /*#__PURE__*/ forwardRef(({ size, cellContentLeft, multiple, flow, filenameWithoutExtension, extension, isHelper, isInsideDropdown, onClick }, ref)=>{
    const textNode = isHelper ? /*#__PURE__*/ React.createElement(FilenameExtensionPart, null, filenameWithoutExtension, ".", extension) : /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(TruncatedFilenamePart, {
        applyEllipsis: !multiple || flow !== 'horizontal'
    }, filenameWithoutExtension.slice(0, -1)), /*#__PURE__*/ React.createElement(FilenameExtensionPart, null, filenameWithoutExtension.at(-1), ".", extension));
    return /*#__PURE__*/ React.createElement(StyledCell, {
        ref: ref,
        stretching: "fixed",
        size: size,
        contentLeft: cellContentLeft,
        contentRight: /*#__PURE__*/ React.createElement(StyledIconButtonCancel, {
            onClick: onClick
        }, /*#__PURE__*/ React.createElement(IconCloseCircleOutline, {
            size: "xs",
            color: "inherit"
        }))
    }, /*#__PURE__*/ React.createElement(FilenameWrapper, {
        isInsideDropdown: isInsideDropdown
    }, textNode));
});
