"use strict";

exports.__esModule = true;
exports.FileDetails = FileDetails;
var _react = _interopRequireWildcard(require("react"));
var _designSystem = require("@wix/design-system");
var _formatBytes = require("./formatBytes");
var _resolveFileByMediaType = require("./resolveFileByMediaType");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/FileCard/FileDetails.tsx";
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
function FileDetails({
  file,
  showDetails
}) {
  const fileSize = (0, _react.useMemo)(() => (0, _formatBytes.formatBytes)(file.sizeInBytes), [file.sizeInBytes]);
  return /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
    gap: "4px",
    direction: "vertical",
    dataHook: `file-details-${file.mediaId}`,
    maxWidth: `calc(100% - ${showDetails ? _resolveFileByMediaType.THUMB_WIDTH + 60 : _resolveFileByMediaType.SMALL_THUMB_WIDTH + 10}px)`,
    paddingRight: !showDetails ? 'SP2' : '0',
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 19,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react.default.createElement(_designSystem.Text, {
    ellipsis: true,
    size: "small",
    dataHook: `file-details-name-${file.mediaId}`,
    paddingRight: "SP2",
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 28,
      columnNumber: 7
    }
  }, file.displayName), showDetails && /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
    verticalAlign: "middle",
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 37,
      columnNumber: 9
    }
  }, /*#__PURE__*/_react.default.createElement(_designSystem.Text, {
    paddingRight: "SP2",
    size: "tiny",
    secondary: true,
    ellipsis: true,
    dataHook: `file-details-size-${file.mediaId}`,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 38,
      columnNumber: 11
    }
  }, fileSize, " ", file.mediaType)));
}
//# sourceMappingURL=FileDetails.js.map