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

19 lines
544 B
TypeScript
Raw Normal View History

2022-06-08 17:14:00 +00:00
import { HTMLProps } from "react";
2022-06-10 15:18:36 +00:00
import { BaseEditable } from "./BaseEditable";
2022-06-08 17:14:00 +00:00
/**
* 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.
2022-06-08 17:14:00 +00:00
*/
2022-06-09 20:45:22 +00:00
export function EditableFilePicker(props: HTMLProps<HTMLInputElement> & { value?: undefined }) {
2022-06-08 17:14:00 +00:00
return (
2022-06-10 15:18:36 +00:00
<BaseEditable
2022-06-08 17:14:00 +00:00
editing={
<input type="file" {...props} />
}
preview={<></>}
/>
)
}