1
Fork 0
mirror of https://github.com/Steffo99/festa.git synced 2024-12-23 07:04:22 +00:00
festa/components/Postcard.tsx

16 lines
No EOL
481 B
TypeScript

import { PostcardContext } from "../contexts/postcard";
import { useDefinedContext } from "../utils/definedContext";
export function Postcard() {
const [postcard, _] = useDefinedContext(PostcardContext)
const postcardUrl = typeof postcard === "string" ? postcard : postcard.src
/* eslint-disable @next/next/no-img-element */
return <>
<div
className="postcard"
style={{backgroundImage: `url(${postcardUrl})`}}
/>
</>
}