Add .gif among supported asset formats

This commit is contained in:
Serkan Reis 2022-09-27 11:31:33 +03:00
parent 596f7806ed
commit 6c3703d97b

View File

@ -4,7 +4,8 @@ export type AssetType = 'image' | 'audio' | 'video' | 'unknown'
export const getAssetType = (assetFileName: string): AssetType => {
const assetType = assetFileName?.split('.').pop() || 'unknown'
if (assetType === 'png' || assetType === 'jpg' || assetType === 'jpeg' || assetType === 'svg') return 'image'
if (assetType === 'png' || assetType === 'jpg' || assetType === 'jpeg' || assetType === 'svg' || assetType === 'gif')
return 'image'
if (assetType === 'mp3' || assetType === 'wav') return 'audio'
if (assetType === 'mp4') return 'video'
return 'unknown'