mirror of
https://github.com/Steffo99/festa.git
synced 2024-12-23 07:04:22 +00:00
19 lines
510 B
TypeScript
19 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>
|
||
|
)
|
||
|
}
|