import React from 'react';
import { Token } from '../Token';
import { parseFilename } from '../_utils/filename';
import { StyledExtension, StyledFilename, StyledFilenameShortcut } from './FileToken.styles';
export var FileTokenInner = function FileTokenInner(_ref) {
  var fullFilename = _ref.fullFilename,
    includeInTabOrder = _ref.includeInTabOrder,
    onClick = _ref.onClick,
    onClose = _ref.onClose,
    qaCloseBtn = _ref.qaCloseBtn;
  var _parseFilename = parseFilename(fullFilename),
    filename = _parseFilename.filename,
    extension = _parseFilename.extension,
    isFilename = _parseFilename.isFilename;
  var name = isFilename ? "".concat(filename, ".") : fullFilename;
  return /*#__PURE__*/React.createElement(Token, {
    tabIndex: includeInTabOrder ? 0 : -1
  }, /*#__PURE__*/React.createElement(Token.Label, {
    onClick: onClick
  }, /*#__PURE__*/React.createElement(StyledFilenameShortcut, null, /*#__PURE__*/React.createElement(StyledFilename, null, name), /*#__PURE__*/React.createElement(StyledExtension, null, extension))), includeInTabOrder && /*#__PURE__*/React.createElement(Token.Remove, {
    "data-qa": qaCloseBtn,
    onClick: onClose
  }));
};
//# sourceMappingURL=FileTokenInner.js.map