1
Fork 0
mirror of https://github.com/Steffo99/festa.git synced 2024-12-23 23:24:23 +00:00
festa/components/editable/EditableFilePicker.tsx

19 lines
No EOL
532 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.
*
* Has no value due to how file inputs function in JS and React.
*/
export function EditableFilePicker(props: HTMLProps<HTMLInputElement> & { value?: undefined }) {
return (
<Editable
editing={
<input type="file" {...props} />
}
preview={<></>}
/>
)
}