"use client"; import { useState } from "react"; import Image from "next/image"; import { Button } from "@/components/ui/button"; import SubscriptionCard from "@/components/SubscriptionCard"; import { HiCheckBadge } from "react-icons/hi2"; import Tabs from "@/components/Tabs"; import useProfile from "@/lib/hooks/useProfile"; import { getTwoLetters, truncateText } from "@/lib/utils"; import ProfileFeed from "./_components/Feed"; import { nip19 } from "nostr-tools"; export default function ProfilePage({ params: { npub }, }: { params: { npub: string; }; }) { const [activeTab, setActiveTab] = useState("feed"); console.log("calling with ", npub); if (npub === "service-worker.js") { throw new Error("Invalid list"); } const { type, data } = nip19.decode(npub); if (type !== "npub") { throw new Error("Invalid list"); } const pubkey = data.toString(); const { profile } = useProfile(pubkey); const demo = [ { id: "1", title: "BTC Radio", description: "BTC Radio is the best fuking show ever. you should sub to it. now", picture: "https://assets.whop.com/cdn-cgi/image/width=1080/https://assets.whop.com/images/images/51602.original.png?1693358530", tags: ["music", "crypto", "art"], }, ]; return (
{profile.name}
} {!!profile?.name && !!profile.nip05 && ( <>{profile.nip05}
> )}{profile.about}
)}