import { closeDialog, dialogSelector, expiredSelector, isSubscribedSelector, levelSelector, refreshSubscription, setDialog, usageSelector, } from "@/store/subscription.ts"; import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from "@/components/ui/dialog.tsx"; import { useDispatch, useSelector } from "react-redux"; import { useTranslation } from "react-i18next"; import "@/assets/pages/subscription.less"; import { openDialog as openQuotaDialog, dialogSelector as quotaDialogSelector, } from "@/store/quota.ts"; import { Calendar, Info } from "lucide-react"; import { useEffectAsync } from "@/utils/hook.ts"; import { selectAuthenticated } from "@/store/auth.ts"; import SubscriptionUsage from "@/components/home/subscription/SubscriptionUsage.tsx"; import Tips from "@/components/Tips.tsx"; import { Upgrade } from "@/components/home/subscription/BuyDialog.tsx"; import { useDeeptrain } from "@/conf/env.ts"; import { useMemo } from "react"; import { getPlan, getPlanName, SubscriptionIcon, } from "@/conf/subscription.tsx"; import { cn } from "@/components/ui/lib/utils.ts"; import { Badge } from "@/components/ui/badge.tsx"; import { subscriptionDataSelector } from "@/store/globals.ts"; import { infoRelayPlanSelector } from "@/store/info.ts"; type PlanItemProps = { level: number; }; function PlanItem({ level }: PlanItemProps) { const { t } = useTranslation(); const current = useSelector(levelSelector); const subscriptionData = useSelector(subscriptionDataSelector); const plan = useMemo( () => getPlan(subscriptionData, level), [subscriptionData, level], ); const name = useMemo(() => getPlanName(level), [level]); return (
({t("sub.include-tax")})
}{t("sub.plan-tip")}