Refactor frontend pages and config components into single-component files for Task 13
This commit is contained in:
21
frontend/src/components/config/CommandField.tsx
Normal file
21
frontend/src/components/config/CommandField.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import { Field, Textarea } from "@fluentui/react-components";
|
||||
|
||||
interface CommandFieldProps {
|
||||
label: string;
|
||||
value: string;
|
||||
onChange: (v: string) => void;
|
||||
}
|
||||
|
||||
export function CommandField({ label, value, onChange }: CommandFieldProps): React.JSX.Element {
|
||||
return (
|
||||
<Field label={label}>
|
||||
<Textarea
|
||||
value={value}
|
||||
onChange={(_e, d) => { onChange(d.value); }}
|
||||
rows={value.split("\n").length + 1}
|
||||
style={{ fontFamily: "monospace", width: "100%" }}
|
||||
placeholder={`${label} command(s)`}
|
||||
/>
|
||||
</Field>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user