File size: 991 Bytes
fcd4478
 
 
 
 
 
c69ef3e
66e93d1
fcd4478
 
 
 
 
abb7588
 
 
 
 
 
 
 
 
 
fcd4478
 
 
abb7588
 
 
 
 
 
 
 
fcd4478
abb7588
 
 
 
fcd4478
 
abb7588
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import React from 'react';
import Image from 'next/image';
import {
	Tooltip,
	TooltipContent,
	TooltipTrigger,
} from '@/components/ui/Tooltip';
import { MediaDetails } from '@/lib/fetch';

export interface MediaTileProps {
	media: MediaDetails;
}

export default function MediaTile({ media }: MediaTileProps) {
	const {
		url,
		thumbnails,
		id,
		name,
		properties: { width, height },
	} = media;
	// const imageSrc = thumbnails.length ? thumbnails[thumbnails.length - 1] : url;
	const imageSrc = url;
	return (
		<Tooltip>
			<TooltipTrigger asChild>
				<Image
					src={imageSrc}
					draggable={false}
					alt="dataset images"
					width={width}
					height={height}
					className="w-full h-auto relative rounded-xl overflow-hidden shadow-md cursor-pointer transition-transform hover:scale-105 box-content"
				/>
			</TooltipTrigger>
			<TooltipContent>
				<p>{name}</p>
				<p className="font-light text-xs">{`${width} x ${height}`}</p>
			</TooltipContent>
		</Tooltip>
	);
}