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

18 lines
510 B
TypeScript

import React from "react"
import { PostcardContext, PostcardSource } from "./base"
import { useStatePostcard } from "./storage"
export type PostcardContextProviderProps = {
defaultPostcard: PostcardSource,
children: React.ReactNode,
}
export const PostcardContextProvider = ({ defaultPostcard, children }: PostcardContextProviderProps) => {
return (
<PostcardContext.Provider value={useStatePostcard(defaultPostcard)}>
{children}
</PostcardContext.Provider>
)
}