"use client"; import { getCustomization } from "@/lib/api"; import { useEffect, useState } from "react"; import { Card, CardDescription, CardHeader, CardTitle } from "./ui/card"; import Markdown from "react-markdown"; import { useTheme } from "next-themes"; import FadeIn from "react-fade-in/lib/FadeIn"; export default function AfterServerView({ server }: { server: string }) { const [description, setDescription] = useState(""); const [discord, setDiscord] = useState(""); const { resolvedTheme } = useTheme(); const [loading, setLoading] = useState(true); useEffect(() => { getCustomization(server).then((b) => { if (b != null) { setDescription(b.description == null ? "" : b.description); setDiscord(b.discord == null ? "" : b.discord); } setLoading(false); }); }, []); if (loading) return <>; return ( <>
{description != "" && ( {description} )} {discord != "" && ( Discord Server