cleanup billing management for admin
This commit is contained in:
@@ -145,7 +145,7 @@ function FreePlanView({
|
||||
<div>
|
||||
<CardTitle>Llink Free</CardTitle>
|
||||
<CardDescription>
|
||||
Current plan · up to 50 particles per day
|
||||
Current plan · up to 50 messages per day
|
||||
</CardDescription>
|
||||
</div>
|
||||
<Badge variant="secondary">Free</Badge>
|
||||
@@ -157,14 +157,6 @@ function FreePlanView({
|
||||
<p className="text-muted-foreground mb-2 px-1 text-xs font-medium uppercase tracking-wider">
|
||||
Upgrade to Pro
|
||||
</p>
|
||||
<ul className="text-muted-foreground mb-4 space-y-1.5 px-1 text-sm">
|
||||
{features.map((f) => (
|
||||
<li key={f} className="flex items-center gap-2">
|
||||
<Check className="text-primary size-3.5" />
|
||||
{f}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
<div className="flex flex-col gap-3 sm:flex-row">
|
||||
<PricingCard
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
import { useCallback, useState } from "react";
|
||||
import { useNavigate, useParams, useSearchParams } from "react-router-dom";
|
||||
import { CircleDot, CircleCheckBig } from "lucide-react";
|
||||
import { CircleDot, CircleCheckBig, CreditCard } from "lucide-react";
|
||||
import { particlePath } from "@/lib/particle-path";
|
||||
import { ParticleListView } from "@/features/particles/particle-list-view";
|
||||
import { VideoAudioToggle } from "@/components/video-audio-toggle";
|
||||
import { ComposeOverlay } from "./compose/compose-overlay";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import { useStreamParticles } from "@/hooks/use-stream-particles";
|
||||
import { useStreamKeyboardNav } from "@/hooks/use-stream-keyboard-nav";
|
||||
import { useNetworks } from "@/hooks/use-networks";
|
||||
import { useAuthStore } from "@/stores/auth-store";
|
||||
|
||||
/**
|
||||
* Route-level component for /:networkId (index).
|
||||
@@ -18,6 +21,11 @@ export default function NetworkRoot() {
|
||||
const navigate = useNavigate();
|
||||
const path = particlePath(networkId!, []);
|
||||
|
||||
const { data: networks } = useNetworks();
|
||||
const network = networks?.find((n) => n.id === networkId);
|
||||
const currentUser = useAuthStore((s) => s.user);
|
||||
const isAdmin = currentUser?.id === network?.admin_human.id;
|
||||
|
||||
const [composeActive, setComposeActive] = useState(false);
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
const statusTab: "open" | "closed" =
|
||||
@@ -60,6 +68,17 @@ export default function NetworkRoot() {
|
||||
<TabsTrigger value="closed"><CircleCheckBig className="size-3" /> Closed</TabsTrigger>
|
||||
</TabsList>
|
||||
</Tabs>
|
||||
{isAdmin && (
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="text-muted-foreground"
|
||||
onClick={() => navigate(`/${networkId}/settings/billing`)}
|
||||
>
|
||||
<CreditCard className="size-3.5" />
|
||||
Billing
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Scrollable content */}
|
||||
|
||||
Reference in New Issue
Block a user