diff --git a/002_source/cms/src/components/dashboard/overview/app-chat.tsx b/002_source/cms/src/components/dashboard/overview/app-chat.tsx index f2c5dca..8c1a689 100644 --- a/002_source/cms/src/components/dashboard/overview/app-chat.tsx +++ b/002_source/cms/src/components/dashboard/overview/app-chat.tsx @@ -1,3 +1,5 @@ +'use client'; + import * as React from 'react'; import Avatar from '@mui/material/Avatar'; import Badge from '@mui/material/Badge'; @@ -16,6 +18,7 @@ import Typography from '@mui/material/Typography'; import { ArrowRight as ArrowRightIcon } from '@phosphor-icons/react/dist/ssr/ArrowRight'; import { ChatCircleText as ChatCircleTextIcon } from '@phosphor-icons/react/dist/ssr/ChatCircleText'; import { DotsThree as DotsThreeIcon } from '@phosphor-icons/react/dist/ssr/DotsThree'; +import { useTranslation } from 'react-i18next'; import { dayjs } from '@/lib/dayjs'; @@ -31,6 +34,7 @@ export interface AppChatProps { } export function AppChat({ messages }: AppChatProps): React.JSX.Element { + const { t } = useTranslation(); return ( } - title="App chat" + title={t('app_chat')} /> - {message.author.name} + {t('message_author_name', { name: message.author.name })} } secondary={ - {message.content} + {t('message_content', { content: message.content })} } /> @@ -96,7 +100,7 @@ export function AppChat({ messages }: AppChatProps): React.JSX.Element { diff --git a/002_source/cms/src/components/dashboard/overview/app-limits.tsx b/002_source/cms/src/components/dashboard/overview/app-limits.tsx index 70efbcd..69171b7 100644 --- a/002_source/cms/src/components/dashboard/overview/app-limits.tsx +++ b/002_source/cms/src/components/dashboard/overview/app-limits.tsx @@ -15,6 +15,7 @@ import Typography from '@mui/material/Typography'; import { Cpu as CpuIcon } from '@phosphor-icons/react/dist/ssr/Cpu'; import { DotsThree as DotsThreeIcon } from '@phosphor-icons/react/dist/ssr/DotsThree'; import { Lightning as LightningIcon } from '@phosphor-icons/react/dist/ssr/Lightning'; +import { Trans, useTranslation } from 'react-i18next'; import { RadialBar, RadialBarChart } from 'recharts'; import { NoSsr } from '@/components/core/no-ssr'; @@ -24,6 +25,7 @@ export interface AppLimitsProps { } export function AppLimits({ usage }: AppLimitsProps): React.JSX.Element { + const { t } = useTranslation(); const chartSize = 240; const data = [ @@ -31,6 +33,10 @@ export function AppLimits({ usage }: AppLimitsProps): React.JSX.Element { { name: 'Usage', value: usage }, ] satisfies { name: string; value: number }[]; + const [usagePct, setUsagePct] = React.useState( + new Intl.NumberFormat('en-US', { style: 'percent', maximumFractionDigits: 2 }).format(usage / 100) + ); + return ( } - title="App limits" + title={t('app_limits')} /> @@ -91,27 +97,25 @@ export function AppLimits({ usage }: AppLimitsProps): React.JSX.Element { }} > - - {new Intl.NumberFormat('en-US', { style: 'percent', maximumFractionDigits: 2 }).format(usage / 100)} - + {usagePct} - You've almost reached your limit + {t('You have almost reached your limit')} - You have used{' '} - {new Intl.NumberFormat('en-US', { style: 'percent', maximumFractionDigits: 2 }).format(usage / 100)} of your - available spots. Upgrade plan to create more projects. + {t('You have used')} {usagePct} {t('of your available spots')} +
+ {t('Upgrade plan to create more projects')}