mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
24 lines
570 B
TypeScript
24 lines
570 B
TypeScript
import React from "react";
|
|
import { Button, Form } from 'react-bootstrap';
|
|
|
|
interface IImageInput {
|
|
isEditing: boolean;
|
|
onImageChange: (event: React.FormEvent<HTMLInputElement>) => void;
|
|
}
|
|
|
|
export const ImageInput: React.FC<IImageInput> = ({ isEditing, onImageChange }) => {
|
|
if (!isEditing) return <div />;
|
|
|
|
return (
|
|
<Form.Label className="image-input">
|
|
<Button variant="secondary">Browse for image...</Button>
|
|
<Form.Control
|
|
type="file"
|
|
onChange={onImageChange}
|
|
accept=".jpg,.jpeg,.png"
|
|
/>
|
|
</Form.Label>
|
|
);
|
|
}
|
|
|