mirror of
https://github.com/ajnart/homarr.git
synced 2026-02-27 17:00:54 +01:00
* feat: Clock widget and dayjs locale standard Co-authored-by: Meier Lukas - Widget options modifications <meierschlumpf@gmail.com> * perf: add improved time state for clock widget * fix: final fixes * refactor: unify selectOptions * chore: fix CI & remove serverdata from clock widget * chore: Change custom title to be under a toggle --------- Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
28 lines
769 B
TypeScript
28 lines
769 B
TypeScript
"use client";
|
|
|
|
import { MultiSelect } from "@homarr/ui";
|
|
|
|
import type { CommonWidgetInputProps } from "./common";
|
|
import { useWidgetInputTranslation } from "./common";
|
|
import { useFormContext } from "./form";
|
|
import type { SelectOption } from "./widget-select-input";
|
|
|
|
export const WidgetMultiSelectInput = ({
|
|
property,
|
|
kind,
|
|
options,
|
|
}: CommonWidgetInputProps<"multiSelect">) => {
|
|
const t = useWidgetInputTranslation(kind, property);
|
|
const form = useFormContext();
|
|
|
|
return (
|
|
<MultiSelect
|
|
label={t("label")}
|
|
data={options.options as unknown as SelectOption[]}
|
|
description={options.withDescription ? t("description") : undefined}
|
|
searchable={options.searchable}
|
|
{...form.getInputProps(`options.${property}`)}
|
|
/>
|
|
);
|
|
};
|