diff --git a/src/components/Form.tsx b/src/components/Form.tsx index f98c8c0..042d6b9 100644 --- a/src/components/Form.tsx +++ b/src/components/Form.tsx @@ -7,6 +7,7 @@ import { FlowComponent, createSignal, createEffect, + For, } from "solid-js"; import { validateInput } from "~/hooks/validation"; import AsteriskIcon from "~icons/ph/asterisk-bold"; @@ -245,3 +246,55 @@ export const NumberInput: Component< /> ); }; + +// TODO: Move input-group into separate component + +export const Select: Component< + { + value: string | number; + options: [string | number, string][]; + label: string; + labelMinWidth?: string; + onChange: (v: any) => void; + } & JSX.InputHTMLAttributes +> = (p) => { + p = mergeProps( + { + labelMinWidth: "95px", + }, + p + ); + const [props, rest] = splitProps(p, [ + "value", + "options", + "label", + "labelMinWidth", + "onChange", + ]); + + return ( +
+
+ + {props.label} + + +
+
+ ); +}; diff --git a/src/components/Settings/Overlay.tsx b/src/components/Settings/Overlay.tsx index 0f6dc95..650ec67 100644 --- a/src/components/Settings/Overlay.tsx +++ b/src/components/Settings/Overlay.tsx @@ -22,6 +22,7 @@ import createAccordion from "../Accordion"; import { Checkbox, NumberInput, + Select, TextArea, TextInput, UnixDateInput, @@ -311,40 +312,19 @@ const SettingsOverlay: Component = () => { />
-
- - Typ neuer Positionen - - -
+