🐛 fix(billing): I18n and styles
This commit is contained in:
parent
e85e545ef4
commit
81e0f21a39
@ -1,7 +1,7 @@
|
|||||||
import { Avatar, AvatarFallback, AvatarImage } from '@shadcn/ui/avatar';
|
import { Avatar, AvatarFallback, AvatarImage } from '@shadcn/ui/avatar';
|
||||||
import { Card, CardDescription, CardHeader, CardTitle } from '@shadcn/ui/card';
|
import { Card, CardDescription, CardHeader, CardTitle } from '@shadcn/ui/card';
|
||||||
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@shadcn/ui/tooltip';
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@shadcn/ui/tooltip';
|
||||||
import { getLocale } from 'next-intl/server';
|
import { getTranslations } from 'next-intl/server';
|
||||||
import Image from 'next/legacy/image';
|
import Image from 'next/legacy/image';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ interface ItemType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default async function Billing({ type }: BillingProps) {
|
export default async function Billing({ type }: BillingProps) {
|
||||||
const locale = await getLocale();
|
const t = await getTranslations('common.billing');
|
||||||
let list: ItemType[] = [];
|
let list: ItemType[] = [];
|
||||||
try {
|
try {
|
||||||
const response = await fetch(BASE_URL, { cache: 'no-store' });
|
const response = await fetch(BASE_URL, { cache: 'no-store' });
|
||||||
@ -39,14 +39,10 @@ export default async function Billing({ type }: BillingProps) {
|
|||||||
return (
|
return (
|
||||||
<TooltipProvider>
|
<TooltipProvider>
|
||||||
<h1 className='text mt-2 font-bold'>
|
<h1 className='text mt-2 font-bold'>
|
||||||
<span>{locale === 'en-US' ? 'Advertisement' : '广告合作'}</span>
|
<span>{t('title')}</span>
|
||||||
<span className='text-muted-foreground ml-2 text-xs'>
|
<span className='text-muted-foreground ml-2 text-xs'>{t('description')}</span>
|
||||||
{locale === 'en-US'
|
|
||||||
? 'Ad revenue helps PPanel continue to release updates'
|
|
||||||
: '广告收入有助于 PPanel 继续发布更新'}
|
|
||||||
</span>
|
|
||||||
</h1>
|
</h1>
|
||||||
<div className='grid grid-cols-1 gap-3 md:grid-cols-3 lg:grid-cols-5'>
|
<div className='grid gap-3 md:grid-cols-3 lg:grid-cols-6'>
|
||||||
{list.map((item, index) => (
|
{list.map((item, index) => (
|
||||||
<Tooltip key={index}>
|
<Tooltip key={index}>
|
||||||
<TooltipTrigger asChild>
|
<TooltipTrigger asChild>
|
||||||
|
|||||||
@ -118,6 +118,7 @@ export default function Statistics() {
|
|||||||
const currentData = trafficData[dataType][timeFrame];
|
const currentData = trafficData[dataType][timeFrame];
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<h1 className='text-lg font-semibold'>统计</h1>
|
||||||
<div className='grid grid-cols-2 gap-3 md:grid-cols-4 lg:grid-cols-8'>
|
<div className='grid grid-cols-2 gap-3 md:grid-cols-4 lg:grid-cols-8'>
|
||||||
{[
|
{[
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,4 +1,8 @@
|
|||||||
{
|
{
|
||||||
|
"billing": {
|
||||||
|
"title": "赞助商",
|
||||||
|
"description": "赞助有助于 PPanel 继续发布更新!"
|
||||||
|
},
|
||||||
"empty": [
|
"empty": [
|
||||||
"Imagine this place filled with exciting content! For now, you'll have to use your imagination...",
|
"Imagine this place filled with exciting content! For now, you'll have to use your imagination...",
|
||||||
"This area mysteriously disappeared, but we're summoning it back!",
|
"This area mysteriously disappeared, but we're summoning it back!",
|
||||||
|
|||||||
@ -1,4 +1,8 @@
|
|||||||
{
|
{
|
||||||
|
"billing": {
|
||||||
|
"title": "赞助商",
|
||||||
|
"description": "赞助有助于 PPanel 继续发布更新!"
|
||||||
|
},
|
||||||
"empty": [
|
"empty": [
|
||||||
"想象一下这里充满了精彩的内容!暂时只能靠想象了…",
|
"想象一下这里充满了精彩的内容!暂时只能靠想象了…",
|
||||||
"这片区域神秘消失了,我们正在召唤它回来!",
|
"这片区域神秘消失了,我们正在召唤它回来!",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user