feat: Add widget integration option (#14)
* wip: add widget integrations * feat: Add integration option to widgets * feat: Add translation for widget integration select * fix: formatting issue * chore: address pull request feedback
This commit is contained in:
@@ -2,5 +2,7 @@
|
||||
|
||||
import { createFormContext } from "@homarr/form";
|
||||
|
||||
import type { WidgetEditModalState } from "../modals/widget-edit-modal";
|
||||
|
||||
export const [FormProvider, useFormContext, useForm] =
|
||||
createFormContext<Record<string, unknown>>();
|
||||
createFormContext<WidgetEditModalState>();
|
||||
|
||||
@@ -19,7 +19,7 @@ export const WidgetMultiSelectInput = ({
|
||||
label={t("label")}
|
||||
data={options.options as unknown as string[]}
|
||||
description={options.withDescription ? t("description") : undefined}
|
||||
{...form.getInputProps(property)}
|
||||
{...form.getInputProps(`options.${property}`)}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@ export const WidgetNumberInput = ({
|
||||
min={options.validate.minValue ?? undefined}
|
||||
max={options.validate.maxValue ?? undefined}
|
||||
step={options.step}
|
||||
{...form.getInputProps(property)}
|
||||
{...form.getInputProps(`options.${property}`)}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -19,7 +19,7 @@ export const WidgetSelectInput = ({
|
||||
label={t("label")}
|
||||
data={options.options as unknown as string[]}
|
||||
description={options.withDescription ? t("description") : undefined}
|
||||
{...form.getInputProps(property)}
|
||||
{...form.getInputProps(`options.${property}`)}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -23,7 +23,7 @@ export const WidgetSliderInput = ({
|
||||
min={options.validate.minValue ?? undefined}
|
||||
max={options.validate.maxValue ?? undefined}
|
||||
step={options.step}
|
||||
{...form.getInputProps(property)}
|
||||
{...form.getInputProps(`options.${property}`)}
|
||||
/>
|
||||
</InputWrapper>
|
||||
);
|
||||
|
||||
@@ -18,7 +18,7 @@ export const WidgetSwitchInput = ({
|
||||
<Switch
|
||||
label={t("label")}
|
||||
description={options.withDescription ? t("description") : undefined}
|
||||
{...form.getInputProps(property, { type: "checkbox" })}
|
||||
{...form.getInputProps(`options.${property}`, { type: "checkbox" })}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@ export const WidgetTextInput = ({
|
||||
<TextInput
|
||||
label={t("label")}
|
||||
description={options.withDescription ? t("description") : undefined}
|
||||
{...form.getInputProps(property)}
|
||||
{...form.getInputProps(`options.${property}`)}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user