chore: implement options component

This commit is contained in:
Sebastian Velez
2023-01-16 16:45:42 -05:00
parent 949fff2cf7
commit b507429e9b
4 changed files with 280 additions and 3 deletions

View File

@@ -0,0 +1,44 @@
import React from 'react';
type Props = {
handleChange: (sites: string) => void;
helpText: string;
label: string;
placeholder?: string;
sites: string;
};
export default function SitesList({
handleChange,
label,
placeholder,
sites,
helpText,
}: Props): JSX.Element {
const textareaChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {
handleChange(event.target.value);
};
return (
<div className="form-group">
<label htmlFor="sites" className="col-lg-2 control-label">
{label}
</label>
<div className="col-lg-10">
<textarea
className="form-control"
rows={3}
onChange={textareaChange}
placeholder={placeholder ?? 'http://google.com'}
value={sites}
></textarea>
<span className="help-block">
{helpText}
<br />
One line per site.
</span>
</div>
</div>
);
}