blob: 0416bd92b72c0062476be63af1b1cbabbfe70018 (
plain) (
blame)
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
44
45
|
import React from "react";
import Image from "next/image";
export interface Image {
height: number;
width: number;
source: string;
}
export interface ThemedImageProps {
title?: string;
dark?: Image;
light?: Image;
priority?: boolean;
}
export function ThemedImage({
title,
light,
dark,
priority = false,
}: ThemedImageProps) {
return (
<>
<div className="block w-full dark:hidden">
<Image
alt={title}
src={light.source}
width={light.width}
height={light.height}
priority={priority}
/>
</div>
<div className="hidden w-full dark:block">
<Image
alt={title}
src={dark.source}
width={dark.width}
height={dark.height}
priority={priority}
/>
</div>
</>
);
}
|