mirror of
https://github.com/Steffo99/festa.git
synced 2024-12-23 07:04:22 +00:00
19 lines
581 B
TypeScript
19 lines
581 B
TypeScript
|
import { HTMLProps } from "react";
|
||
|
import { Editable } from "./Editable";
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Controlled input component which displays an `input[type="file"]` in editing mode, and is invisible in preview mode.
|
||
|
*
|
||
|
* Value is the file's [fakepath](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#value), as a string.
|
||
|
*/
|
||
|
export function EditableFile(props: HTMLProps<HTMLInputElement> & { value: string }) {
|
||
|
return (
|
||
|
<Editable
|
||
|
editing={
|
||
|
<input type="file" {...props} />
|
||
|
}
|
||
|
preview={<></>}
|
||
|
/>
|
||
|
)
|
||
|
}
|