mirror of
https://github.com/Steffo99/festa.git
synced 2024-12-23 07:04:22 +00:00
16 lines
No EOL
531 B
TypeScript
16 lines
No EOL
531 B
TypeScript
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> & {value: string | undefined}) {
|
|
const [editing,] = useDefinedContext(EditingContext)
|
|
|
|
return <>
|
|
{editing ?
|
|
<input type="file" value={undefined} {...props}/>
|
|
: null}
|
|
<Postcard src={value}/>
|
|
</>
|
|
} |