"use strict";

import { View } from 'react-native';
import { MediaContainer, MediaImage } from './StyledInputComponents/StyledInputComponents';
import { FileIcon } from '../../assets/icons';
import { RemoveButton, RemoveButtonText } from './StyledComponents';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
export const MediaFilePreview = ({
  filePreviews,
  handleRemoveImage
}) => {
  return /*#__PURE__*/_jsx(MediaContainer, {
    children: filePreviews.map((file, index) => {
      const isImageOrVideo = file.type?.startsWith('image') || file.type?.startsWith('video');
      return /*#__PURE__*/_jsxs(View, {
        children: [isImageOrVideo ? /*#__PURE__*/_jsx(MediaImage, {
          source: {
            uri: file.uri
          }
        }) : /*#__PURE__*/_jsx(View, {
          style: {
            width: 70,
            height: 70,
            borderRadius: 8
          },
          children: /*#__PURE__*/_jsx(FileIcon, {
            width: 70,
            height: 70
          })
        }), /*#__PURE__*/_jsx(RemoveButton, {
          onPress: () => handleRemoveImage(index),
          children: /*#__PURE__*/_jsx(RemoveButtonText, {
            children: "\xD7"
          })
        })]
      }, `${file.name}_${index}`);
    })
  });
};
//# sourceMappingURL=MediaFilePreview.js.map