"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.MediaFilePreview = void 0;
var _reactNative = require("react-native");
var _StyledInputComponents = require("./StyledInputComponents/StyledInputComponents");
var _icons = require("../../assets/icons");
var _StyledComponents = require("./StyledComponents");
var _jsxRuntime = require("react/jsx-runtime");
const MediaFilePreview = ({
  filePreviews,
  handleRemoveImage
}) => {
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_StyledInputComponents.MediaContainer, {
    children: filePreviews.map((file, index) => {
      const isImageOrVideo = file.type?.startsWith('image') || file.type?.startsWith('video');
      return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
        children: [isImageOrVideo ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_StyledInputComponents.MediaImage, {
          source: {
            uri: file.uri
          }
        }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
          style: {
            width: 70,
            height: 70,
            borderRadius: 8
          },
          children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.FileIcon, {
            width: 70,
            height: 70
          })
        }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_StyledComponents.RemoveButton, {
          onPress: () => handleRemoveImage(index),
          children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_StyledComponents.RemoveButtonText, {
            children: "\xD7"
          })
        })]
      }, `${file.name}_${index}`);
    })
  });
};
exports.MediaFilePreview = MediaFilePreview;
//# sourceMappingURL=MediaFilePreview.js.map