From 187fe40c089078e6062cd670186e086b93afbf1c Mon Sep 17 00:00:00 2001 From: louiscklaw Date: Mon, 14 Apr 2025 11:05:23 +0800 Subject: [PATCH] build ok, --- .../dashboard/overview/helper-widget.tsx | 10 +++++++--- .../dashboard/overview/subscriptions.tsx | 17 +++++++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/002_source/cms/src/components/dashboard/overview/helper-widget.tsx b/002_source/cms/src/components/dashboard/overview/helper-widget.tsx index 9d3cb79..6f326c7 100644 --- a/002_source/cms/src/components/dashboard/overview/helper-widget.tsx +++ b/002_source/cms/src/components/dashboard/overview/helper-widget.tsx @@ -1,3 +1,5 @@ +'use client'; + import * as React from 'react'; import Card from '@mui/material/Card'; import CardActions from '@mui/material/CardActions'; @@ -6,6 +8,7 @@ import Divider from '@mui/material/Divider'; import Stack from '@mui/material/Stack'; import Typography from '@mui/material/Typography'; import type { Icon } from '@phosphor-icons/react/dist/lib/types'; +import { useTranslation } from 'react-i18next'; export interface HelperWidgetProps { action: React.ReactNode; @@ -16,6 +19,7 @@ export interface HelperWidgetProps { } export function HelperWidget({ action, description, icon: Icon, label, title }: HelperWidgetProps): React.JSX.Element { + const { t } = useTranslation(); return ( @@ -34,13 +38,13 @@ export function HelperWidget({ action, description, icon: Icon, label, title }: }} > - {label} + {t(label)} - {title} + {t(title)} - {description} + {t(description)} diff --git a/002_source/cms/src/components/dashboard/overview/subscriptions.tsx b/002_source/cms/src/components/dashboard/overview/subscriptions.tsx index 05c78eb..27ee541 100644 --- a/002_source/cms/src/components/dashboard/overview/subscriptions.tsx +++ b/002_source/cms/src/components/dashboard/overview/subscriptions.tsx @@ -1,3 +1,5 @@ +'use client'; + import * as React from 'react'; import Avatar from '@mui/material/Avatar'; import Button from '@mui/material/Button'; @@ -16,6 +18,7 @@ import Typography from '@mui/material/Typography'; import { ArrowRight as ArrowRightIcon } from '@phosphor-icons/react/dist/ssr/ArrowRight'; import { ContactlessPayment as ContactlessPaymentIcon } from '@phosphor-icons/react/dist/ssr/ContactlessPayment'; import { DotsThree as DotsThreeIcon } from '@phosphor-icons/react/dist/ssr/DotsThree'; +import { useTranslation } from 'react-i18next'; export interface Subscription { id: string; @@ -31,6 +34,7 @@ export interface SubscriptionsProps { } export function Subscriptions({ subscriptions }: SubscriptionsProps): React.JSX.Element { + const { t } = useTranslation(); return ( } - title="Our subscriptions" + title={t('Our subscriptions')} /> @@ -51,7 +55,7 @@ export function Subscriptions({ subscriptions }: SubscriptionsProps): React.JSX. @@ -59,11 +63,12 @@ export function Subscriptions({ subscriptions }: SubscriptionsProps): React.JSX. } function SubscriptionItem({ subscription }: { subscription: Subscription }): React.JSX.Element { + const { t } = useTranslation(); const { label, color } = ( { - paid: { label: 'Paid', color: 'success' }, - canceled: { label: 'Canceled', color: 'error' }, - expiring: { label: 'Expiring', color: 'warning' }, + paid: { label: t('Paid'), color: 'success' }, + canceled: { label: t('Canceled'), color: 'error' }, + expiring: { label: t('Expiring'), color: 'warning' }, } as const )[subscription.status]; @@ -90,7 +95,7 @@ function SubscriptionItem({ subscription }: { subscription: Subscription }): Rea {subscription.costs}{' '} - /{subscription.billingCycle} + /{t(subscription.billingCycle)} }