point-dashboard/src/Components/Ui/FileInput.tsx
KarimAldeen edf92d1a22 test
2024-04-03 12:14:43 +03:00

27 lines
651 B
TypeScript

import React from 'react'
import 'bootstrap/dist/css/bootstrap.min.css';
import { Input } from 'reactstrap';
import { useFormikContext } from 'formik';
type FileInputProps = {
name:string,
label:string,
accept:string,
onChange:any
}
function FileInput({name , accept="image/*" ,label , onChange} :FileInputProps) {
return (
<div className="custom-file-input">
<label className="custom-file-label" htmlFor="inputGroupFile01">
{label}
</label>
<Input accept={accept} id="inputGroupFile01" name={name} onChange={onChange}
type="file" className="custom-file-input" />
</div>
)
}
export default FileInput