1
Fork 0
mirror of https://github.com/Steffo99/festa.git synced 2024-10-16 15:07:27 +00:00
festa/components/Postcard.tsx

16 lines
440 B
TypeScript
Raw Normal View History

2022-05-24 16:55:21 +00:00
import Image from "next/image";
import { PostcardContext } from "../contexts/postcard";
2022-05-27 00:46:30 +00:00
import { useDefinedContext } from "../utils/definedContext";
2022-05-24 16:55:21 +00:00
export function Postcard() {
const [postcard, _] = useDefinedContext(PostcardContext)
return (
2022-05-29 03:00:48 +00:00
<img
2022-05-24 16:55:21 +00:00
className="postcard"
src={typeof postcard === "string" ? postcard : postcard.src}
alt=""
draggable={false}
/>
)
}