import { InfoIcon, LoaderCircleIcon } from 'lucide-react' import { useTranslation } from 'react-i18next' import type { IPicGoCloudBillingOverview, IPicGoCloudUsage } from '#/types/cloud' import { Button } from '@/components/ui/button' import { Skeleton } from '@/components/ui/skeleton' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { cn } from '@/lib/utils' import { capitalizePlanCode, isQuotaDowngraded } from '@/utils/plan' import { computePercent, formatCountDimension, formatStorageDimension, isOverQuota } from './cloud-plan-usage-helpers' interface UsageBodyProps { data: IPicGoCloudUsage | null billing: IPicGoCloudBillingOverview | null isLoading: boolean isError: boolean isFetching: boolean onRetry: () => void } export function UsageBody ({ data, billing, isLoading, isError, isFetching, onRetry }: UsageBodyProps) { const { t } = useTranslation() const storageLabel = t('PICGO_CLOUD_STORAGE_LABEL') const filesLabel = t('PICGO_CLOUD_FILES_LABEL') if (isLoading) { return (
{t('PICGO_CLOUD_USAGE_LOAD_FAILED')}