🐛 fix(locale): Document

This commit is contained in:
web@ppanel 2024-11-17 13:31:05 +07:00
parent 0a8109bbc4
commit 6f0fa20737
4 changed files with 11 additions and 7 deletions

View File

@ -9,9 +9,11 @@ import { useOutsideClick } from '@shadcn/ui/hooks/use-outside-click';
import { cn } from '@shadcn/ui/lib/utils';
import { useQuery } from '@tanstack/react-query';
import { AnimatePresence, motion } from 'framer-motion';
import { useTranslations } from 'next-intl';
import { useEffect, useId, useRef, useState } from 'react';
export function DocumentButton({ items }: { items: API.DocumentItem[] }) {
const t = useTranslations('document');
const [active, setActive] = useState<API.DocumentItem | boolean | null>(null);
const id = useId();
const ref = useRef<HTMLDivElement>(null);
@ -126,7 +128,7 @@ export function DocumentButton({ items }: { items: API.DocumentItem[] }) {
'rounded-full',
)}
>
{t('read')}
</motion.button>
</motion.div>
))}

View File

@ -8,6 +8,7 @@ import { useOutsideClick } from '@shadcn/ui/hooks/use-outside-click';
import { cn } from '@shadcn/ui/lib/utils';
import { useQuery } from '@tanstack/react-query';
import { AnimatePresence, motion } from 'framer-motion';
import { useTranslations } from 'next-intl';
import { useEffect, useId, useRef, useState } from 'react';
interface Item {
@ -15,6 +16,8 @@ interface Item {
title: string;
}
export function TutorialButton({ items }: { items: Item[] }) {
const t = useTranslations('document');
const [active, setActive] = useState<Item | boolean | null>(null);
const id = useId();
const ref = useRef<HTMLDivElement>(null);
@ -143,7 +146,7 @@ export function TutorialButton({ items }: { items: Item[] }) {
'rounded-full',
)}
>
{t('read')}
</motion.button>
</motion.div>
))}

View File

@ -1,8 +1,6 @@
{
"back": "Back",
"category": "Category",
"all": "All",
"document": "Document",
"read": "Read",
"tags": "Tags",
"title": "Title",
"updatedAt": "Updated At"
"tutorial": "Tutorial"
}

View File

@ -1,5 +1,6 @@
{
"all": "全部",
"document": "文档",
"read": "阅读",
"tutorial": "教程"
}