The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/client/components/message/content/urlPreviews/UrlPreviewResolver.tsx

21 lines
644 B

import type { ReactElement } from 'react';
import UrlAudioPreview from './UrlAudioPreview';
import UrlImagePreview from './UrlImagePreview';
import type { UrlPreviewMetadata } from './UrlPreviewMetadata';
import UrlVideoPreview from './UrlVideoPreview';
const UrlPreviewResolver = ({ url, type, originalType }: UrlPreviewMetadata): ReactElement | null => {
switch (type) {
case 'audio':
return <UrlAudioPreview url={url} />;
case 'video':
return <UrlVideoPreview url={url} originalType={originalType} />;
case 'image':
return <UrlImagePreview url={url} />;
default:
return null;
}
};
export default UrlPreviewResolver;