import React from 'react';
import { Download, X, FileText, Image, Music } from 'lucide-react';
import { formatFileSize } from '../../utils/fileValidation';
const FilePreview = ({ file, onRemove, onDownload }) => {
const getFileIcon = () => {
if (file.type.startsWith('image/')) return ;
if (file.type.startsWith('audio/')) return ;
return ;
};
const getFileType = () => {
if (file.type.startsWith('image/')) return 'Image';
if (file.type.startsWith('audio/')) return 'Audio';
if (file.type === 'application/pdf') return 'PDF';
if (file.type.startsWith('text/')) return 'Text';
return 'File';
};
return (
{getFileIcon()}
{file.name}
{getFileType()} • {formatFileSize(file.size)}
{onDownload && (
)}
{onRemove && (
)}
);
};
export default FilePreview;