1
Fork 0
mirror of https://github.com/Steffo99/festa.git synced 2024-12-22 22:54:22 +00:00
festa/components/editable/EditablePostcard.tsx

16 lines
501 B
TypeScript
Raw Normal View History

2022-06-05 21:03:48 +00:00
import { HTMLProps } from "react";
import { EditingContext } from "../../contexts/editing";
import { useDefinedContext } from "../../utils/definedContext";
import { Postcard } from "../postcard/Postcard";
export function EditablePostcard({value, ...props}: HTMLProps<HTMLInputElement>) {
const [editing,] = useDefinedContext(EditingContext)
return <>
{editing ?
<input type="file" value={undefined} {...props}/>
: null}
<Postcard src={value}/>
</>
}