import {IconFile} from 'sentry/icons';
import {fileExtensionToPlatform, getFileExtension} from 'sentry/utils/fileExtension';
import theme from 'sentry/utils/theme';
type Props = {
fileName: string;
className?: string;
size?: string;
};
const FileIcon = ({fileName, size: providedSize = 'sm', className}: Props) => {
const fileExtension = getFileExtension(fileName);
const iconName = fileExtension ? fileExtensionToPlatform(fileExtension) : null;
const size = theme.iconSizes[providedSize] ?? providedSize;
if (!iconName) {
return ;
}
return (
);
};
export default FileIcon;