mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-10 00:46:15 +01:00
23 lines
543 B
TypeScript
23 lines
543 B
TypeScript
|
/**
|
||
|
* This component shows input field with its label, styled
|
||
|
*/
|
||
|
|
||
|
import React from 'react';
|
||
|
|
||
|
interface LabelledInputProps {
|
||
|
id: string,
|
||
|
type: string,
|
||
|
label: string,
|
||
|
value: any,
|
||
|
onChange: (value: any) => void
|
||
|
}
|
||
|
|
||
|
export const LabelledInput: React.FC<LabelledInputProps> = ({ id, type, label, value, onChange }) => {
|
||
|
return (
|
||
|
<div className="input-with-label">
|
||
|
<label className="label" htmlFor={id}>{label}</label>
|
||
|
<input className="input" id={id} type={type} value={value} onChange={onChange} />
|
||
|
</div>
|
||
|
);
|
||
|
}
|