Created the ConfigurationRow.jsx

This commit is contained in:
Mathias Wagner 2023-06-01 19:49:06 +02:00
parent 4fd22e42ac
commit 36d4d278a2
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

View File

@ -0,0 +1,21 @@
import "./styles.sass";
import {faSquareRootVariable} from "@fortawesome/free-solid-svg-icons";
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
export const ConfigurationRow = ({text, icon = faSquareRootVariable, type = "input", options, value, setValue}) => {
return (
<div className="configuration-row">
<div className="left-area">
<FontAwesomeIcon icon={icon} />
<p>{text}</p>
</div>
{type === "select" && <select className="input-field" value={value} onChange={(e) => setValue(e.target.value)}>
{options.map((option) => <option key={option}>{option}</option>)}
</select>}
{type === "input" && <input className="input-field" type="text" placeholder={text} value={value}
onChange={(e) => setValue(e.target.value)} />}
</div>
);
}