diff --git a/apps/nextjs/src/app/[locale]/widgets/[kind]/_content.tsx b/apps/nextjs/src/app/[locale]/widgets/[kind]/_content.tsx index f1a43a538..f15666bde 100644 --- a/apps/nextjs/src/app/[locale]/widgets/[kind]/_content.tsx +++ b/apps/nextjs/src/app/[locale]/widgets/[kind]/_content.tsx @@ -1,7 +1,6 @@ "use client"; import { useState } from "react"; -import type { WidgetOptionDefinition } from "node_modules/@homarr/widgets/src/options"; import type { IntegrationKind, WidgetKind } from "@homarr/definitions"; import { ActionIcon, Affix, IconPencil } from "@homarr/ui"; @@ -28,15 +27,11 @@ export const WidgetPreviewPageContent = ({ integrationData, }: WidgetPreviewPageContentProps) => { const currentDefinition = widgetImports[kind].definition; - const options = currentDefinition.options as Record< - string, - WidgetOptionDefinition - >; const [state, setState] = useState<{ options: Record; integrations: string[]; }>({ - options: reduceWidgetOptionsWithDefaultValues(kind, options), + options: reduceWidgetOptionsWithDefaultValues(kind, {}), integrations: [], }); @@ -67,7 +62,7 @@ export const WidgetPreviewPageContent = ({ integrationData: integrationData.filter( (integration) => "supportedIntegrations" in currentDefinition && - currentDefinition.supportedIntegrations.some( + (currentDefinition.supportedIntegrations as string[]).some( (kind) => kind === integration.kind, ), ), diff --git a/packages/translation/src/lang/de.ts b/packages/translation/src/lang/de.ts index 06325fb40..519b03c09 100644 --- a/packages/translation/src/lang/de.ts +++ b/packages/translation/src/lang/de.ts @@ -1,5 +1,9 @@ import "dayjs/locale/de"; +import dayjs from "dayjs"; + +dayjs.locale("de"); + export default { user: { page: { diff --git a/packages/translation/src/lang/en.ts b/packages/translation/src/lang/en.ts index d7fc4ac81..697fc18bf 100644 --- a/packages/translation/src/lang/en.ts +++ b/packages/translation/src/lang/en.ts @@ -306,15 +306,34 @@ export default { name: "Date and time", description: "Displays the current date and time.", option: { + customTitleToggle: { + label: "Custom Title/City display", + description: + "Show off a custom title or the name of the city/country on top of the clock.", + }, + customTitle: { + label: "Title", + }, is24HourFormat: { label: "24-hour format", description: "Use 24-hour format instead of 12-hour format", }, - isLocaleTime: { - label: "Use locale time", + showSeconds: { + label: "Display seconds", + }, + useCustomTimezone: { + label: "Use a fixed timezone", }, timezone: { label: "Timezone", + description: "Choose the timezone following the IANA standard", + }, + showDate: { + label: "Show the date", + }, + dateFormat: { + label: "Date Format", + description: "How the date should look like", }, }, }, diff --git a/packages/widgets/src/_inputs/widget-multiselect-input.tsx b/packages/widgets/src/_inputs/widget-multiselect-input.tsx index 759a326af..745d33369 100644 --- a/packages/widgets/src/_inputs/widget-multiselect-input.tsx +++ b/packages/widgets/src/_inputs/widget-multiselect-input.tsx @@ -5,6 +5,7 @@ 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, @@ -17,8 +18,9 @@ export const WidgetMultiSelectInput = ({ return ( ); diff --git a/packages/widgets/src/_inputs/widget-select-input.tsx b/packages/widgets/src/_inputs/widget-select-input.tsx index ad36118b1..253350328 100644 --- a/packages/widgets/src/_inputs/widget-select-input.tsx +++ b/packages/widgets/src/_inputs/widget-select-input.tsx @@ -6,6 +6,20 @@ import type { CommonWidgetInputProps } from "./common"; import { useWidgetInputTranslation } from "./common"; import { useFormContext } from "./form"; +export type SelectOption = + | { + value: string; + label: string; + } + | string; + +export type inferSelectOptionValue = + TOption extends { + value: infer TValue; + } + ? TValue + : TOption; + export const WidgetSelectInput = ({ property, kind, @@ -17,8 +31,9 @@ export const WidgetSelectInput = ({ return (