mirror of
https://github.com/ajnart/homarr.git
synced 2026-02-27 17:00:54 +01:00
* feat: update prettier configuration for print width * chore: apply code formatting to entire repository * fix: remove build files * fix: format issue --------- Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
26 lines
965 B
TypeScript
26 lines
965 B
TypeScript
import type { WidgetOptionType } from "../options";
|
|
import { WidgetAppInput } from "./widget-app-input";
|
|
import { WidgetLocationInput } from "./widget-location-input";
|
|
import { WidgetMultiSelectInput } from "./widget-multiselect-input";
|
|
import { WidgetNumberInput } from "./widget-number-input";
|
|
import { WidgetSelectInput } from "./widget-select-input";
|
|
import { WidgetSliderInput } from "./widget-slider-input";
|
|
import { WidgetSwitchInput } from "./widget-switch-input";
|
|
import { WidgetTextInput } from "./widget-text-input";
|
|
|
|
const mapping = {
|
|
text: WidgetTextInput,
|
|
location: WidgetLocationInput,
|
|
multiSelect: WidgetMultiSelectInput,
|
|
multiText: () => null,
|
|
number: WidgetNumberInput,
|
|
select: WidgetSelectInput,
|
|
slider: WidgetSliderInput,
|
|
switch: WidgetSwitchInput,
|
|
app: WidgetAppInput,
|
|
} satisfies Record<WidgetOptionType, unknown>;
|
|
|
|
export const getInputForType = <TType extends WidgetOptionType>(type: TType) => {
|
|
return mapping[type];
|
|
};
|