* 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
25 lines
614 B
TypeScript
25 lines
614 B
TypeScript
"use client";
|
|
|
|
import { TextInput } from "@homarr/ui";
|
|
|
|
import type { CommonWidgetInputProps } from "./common";
|
|
import { useWidgetInputTranslation } from "./common";
|
|
import { useFormContext } from "./form";
|
|
|
|
export const WidgetTextInput = ({
|
|
property,
|
|
sort: widgetSort,
|
|
options,
|
|
}: CommonWidgetInputProps<"text">) => {
|
|
const t = useWidgetInputTranslation(widgetSort, property);
|
|
const form = useFormContext();
|
|
|
|
return (
|
|
<TextInput
|
|
label={t("label")}
|
|
description={options.withDescription ? t("description") : undefined}
|
|
{...form.getInputProps(`options.${property}`)}
|
|
/>
|
|
);
|
|
};
|