import { DirectoryFile } from '/lib/types.ts'; import { PHOTO_IMAGE_EXTENSIONS, PHOTO_VIDEO_EXTENSIONS } from '/lib/utils/photos.ts'; interface ListPhotosProps { files: DirectoryFile[]; } export default function ListPhotos( { files, }: ListPhotosProps, ) { return (
{files.length === 0 ? (
No photos to show
) : (
{files.map((file) => { const lowercaseFileName = file.file_name.toLowerCase(); const extensionName = lowercaseFileName.split('.').pop() || ''; const isImage = PHOTO_IMAGE_EXTENSIONS.some((extension) => extension === extensionName); const isVideo = PHOTO_VIDEO_EXTENSIONS.some((extension) => extension === extensionName); return ( ); })}
)}
); }