mirror of
https://github.com/bspeice/speice.io
synced 2025-04-27 00:01:45 -04:00
13 lines
364 B
TypeScript
13 lines
364 B
TypeScript
import {useColorMode} from "@docusaurus/theme-common";
|
|
import React from "react";
|
|
|
|
interface Props {
|
|
srcLight: string;
|
|
srcDark: string;
|
|
alt: string;
|
|
}
|
|
const DualImage = ({srcLight, srcDark, alt}: Props) => {
|
|
const {colorMode} = useColorMode();
|
|
return <img src={colorMode === "dark" ? srcDark : srcLight} alt={alt} />
|
|
}
|
|
export default DualImage; |