mirror of
https://github.com/Steffo99/festa.git
synced 2024-12-23 07:04:22 +00:00
18 lines
514 B
TypeScript
18 lines
514 B
TypeScript
import React from "react"
|
|
import { PostcardContext, PostcardSource } from "./base"
|
|
import { usePostcardStorage } from "./storage"
|
|
|
|
|
|
export type PostcardContextProviderProps = {
|
|
defaultPostcard: PostcardSource,
|
|
children: React.ReactNode,
|
|
}
|
|
|
|
|
|
export const PostcardContextProvider = ({ defaultPostcard, children }: PostcardContextProviderProps) => {
|
|
return (
|
|
<PostcardContext.Provider value={usePostcardStorage(defaultPostcard)}>
|
|
{children}
|
|
</PostcardContext.Provider>
|
|
)
|
|
}
|