diff --git a/src/components/Dashboard/Tiles/Widgets/WidgetsRemoveModal.tsx b/src/components/Dashboard/Tiles/Widgets/WidgetsRemoveModal.tsx index dc1469d51..0afedf520 100644 --- a/src/components/Dashboard/Tiles/Widgets/WidgetsRemoveModal.tsx +++ b/src/components/Dashboard/Tiles/Widgets/WidgetsRemoveModal.tsx @@ -1,7 +1,6 @@ import { Button, Group, Stack, Text } from '@mantine/core'; import { ContextModalProps } from '@mantine/modals'; import { Trans, useTranslation } from 'next-i18next'; -import React from 'react'; import { useConfigContext } from '../../../../config/provider'; import { useConfigStore } from '../../../../config/store'; diff --git a/src/pages/user/preferences.tsx b/src/pages/user/preferences.tsx index 08eb89528..8ec563950 100644 --- a/src/pages/user/preferences.tsx +++ b/src/pages/user/preferences.tsx @@ -68,7 +68,7 @@ const SettingsComponent = ({ country: language.country, })); - const { t } = useTranslation('user/preferences'); + const { t } = useTranslation(['user/preferences', 'common']); const { i18nZodResolver } = useI18nZodResolver(); diff --git a/src/widgets/dashDot/DashDotGraph.tsx b/src/widgets/dashDot/DashDotGraph.tsx index 28d7d2382..21c5dbc45 100644 --- a/src/widgets/dashDot/DashDotGraph.tsx +++ b/src/widgets/dashDot/DashDotGraph.tsx @@ -4,8 +4,12 @@ import { useTranslation } from 'next-i18next'; import { DashDotCompactNetwork, DashDotInfo } from './DashDotCompactNetwork'; import { DashDotCompactStorage } from './DashDotCompactStorage'; +import { CustomTypeOptions } from 'i18next'; + +type GraphType = keyof CustomTypeOptions['resources']['modules/dashdot']['card']['graphs']; + interface DashDotGraphProps { - graph: string; + graph: GraphType; graphHeight: number; isCompact: boolean; multiView: boolean; diff --git a/src/widgets/weather/WeatherIcon.tsx b/src/widgets/weather/WeatherIcon.tsx index a32d9ffef..e92f6d90f 100644 --- a/src/widgets/weather/WeatherIcon.tsx +++ b/src/widgets/weather/WeatherIcon.tsx @@ -11,6 +11,8 @@ import { IconSun, } from '@tabler/icons-react'; import { useTranslation } from 'next-i18next'; +import { TranslationNamespace } from '~/i18n'; +import { CustomTypeOptions } from 'i18next'; interface WeatherIconProps { code: number; @@ -36,7 +38,9 @@ export const WeatherIcon = ({ code }: WeatherIconProps) => { ); }; -type WeatherDefinitionType = { icon: Icon; name: string; codes: number[] }; + +type WeatherDescription = keyof CustomTypeOptions['resources']['modules/weather']['card']['weatherDescriptions']; +type WeatherDefinitionType = { icon: Icon; name: WeatherDescription; codes: number[] }; // 0 Clear sky // 1, 2, 3 Mainly clear, partly cloudy, and overcast