* 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
26 lines
666 B
TypeScript
26 lines
666 B
TypeScript
"use client";
|
|
|
|
import { MultiSelect } from "@homarr/ui";
|
|
|
|
import type { CommonWidgetInputProps } from "./common";
|
|
import { useWidgetInputTranslation } from "./common";
|
|
import { useFormContext } from "./form";
|
|
|
|
export const WidgetMultiSelectInput = ({
|
|
property,
|
|
sort,
|
|
options,
|
|
}: CommonWidgetInputProps<"multiSelect">) => {
|
|
const t = useWidgetInputTranslation(sort, property);
|
|
const form = useFormContext();
|
|
|
|
return (
|
|
<MultiSelect
|
|
label={t("label")}
|
|
data={options.options as unknown as string[]}
|
|
description={options.withDescription ? t("description") : undefined}
|
|
{...form.getInputProps(`options.${property}`)}
|
|
/>
|
|
);
|
|
};
|