"use client"; import { cn } from "@/lib/utils"; import { Button } from "@/components/ui/button"; import { RiArrowRightLine } from "react-icons/ri"; import useEvents from "@/lib/hooks/useEvents"; import useProfile from "@/lib/hooks/useProfile"; import { nip19 } from "nostr-tools"; import { EXPLORE_CALENDARS } from "@/constants/app"; import { getTagValues } from "@/lib/nostr/utils"; import { NDKEvent, NDKKind, NDKUserProfile } from "@nostr-dev-kit/ndk"; import { useNDK } from "@nostr-dev-kit/ndk-react"; import CalendarCard, { LoadingCalendarCard } from "../_components/CalendarCard"; export default function ExploreCalendars() { return (

Explore Calendars

); } function HorizontalCarousel() { const { events } = useEvents({ filter: { kinds: [31924 as NDKKind], limit: 5, }, }); if (events.length) { return (
{events.map((calendar, index) => (
))}
); } return (
{Array.from(Array(5)).map((_, index) => (
))}
); } function Calendar({ encodedEvent }: { encodedEvent: string }) { const { type, data } = nip19.decode(encodedEvent); if (type !== "naddr") { throw new Error("impoper type"); } const { pubkey, identifier, kind } = data; const { events } = useEvents({ filter: { authors: [pubkey], ["#d"]: [identifier], kinds: [31924 as NDKKind], limit: 1, }, }); const event = events[0]; if (!event) { return null; } return ; }