import React from 'react'; import cn from 'classnames'; import { TextDocumentSvg, AudioFileSvg, PlaySvg } from '../../icons'; import './PreviewFileMessage.scss'; const iconDictionary = { document: TextDocumentSvg, audio: AudioFileSvg, video: PlaySvg, }; export interface PreviewFileMessageProps { type?: 'document' | 'audio' | 'video'; name: string; src?: string; className?: string; } export default function PreviewFileMessage({ type = 'document', name, src, className, }: PreviewFileMessageProps) { const Icon = iconDictionary[type]; return (
{src ? ( ) : ( )} {name}
); }