import { Avatar, AvatarFallback, AvatarImage } from '@shadcn/ui/avatar'; import { Card, CardDescription, CardHeader, CardTitle } from '@shadcn/ui/card'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@shadcn/ui/tooltip'; import { getLocale } from 'next-intl/server'; import Image from 'next/legacy/image'; import Link from 'next/link'; const BASE_URL = 'https://cdn.jsdelivr.net/gh/perfect-panel/ppanel-assets/billing/index.json'; interface BillingProps { type: 'dashboard' | 'payment'; } export default async function Billing({ type }: BillingProps) { const locale = await getLocale(); const response = await fetch(BASE_URL, { cache: 'no-store' }); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } const data = await response.json(); if (data[type].length === 0) return null; return (

{locale === 'en-US' ? 'Advertisement' : '广告合作'} {locale === 'en-US' ? 'Ad revenue helps PPanel continue to release updates' : '广告收入有助于 PPanel 继续发布更新'}

{data[type].map((item, index) => ( {item.title}
{item.title} {item.description}

{item.description}

))}
); }