import { formatDate, fromUnix } from "@/lib/utils/dates"; import Link from "next/link"; import { cn } from "@/lib/utils"; import { Button } from "@/components/ui/button"; import Image from "next/image"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import SmallProfileLine from "@/components/ProfileContainers/SmallProfileLine"; import AvatarStack from "@/components/ProfileContainers/AvatarStack"; import { NDKEvent } from "@nostr-dev-kit/ndk"; import { getTagValues, getTagAllValues, getTagsValues, } from "@/lib/nostr/utils"; import { HiOutlineMapPin, HiOutlineUserCircle } from "react-icons/hi2"; import { RxClock, RxCalendar } from "react-icons/rx"; import { Skeleton } from "@/components/ui/skeleton"; import { AspectRatio } from "@/components/ui/aspect-ratio"; type LargeFeedCardProps = { event: NDKEvent; }; export default function LargeFeedCard({ event }: LargeFeedCardProps) { const { tags, pubkey, content } = event; const image = getTagValues("image", tags); const location = getTagValues("location", tags) ?? getTagValues("address", tags); const users = getTagsValues("p", tags).filter(Boolean); console.log("Users", users); const startDate = getTagValues("start", tags) ? new Date(parseInt(getTagValues("start", tags) as string) * 1000) : null; const endDate = getTagValues("end", tags) ? new Date(parseInt(getTagValues("end", tags) as string) * 1000) : null; return ( {getTagValues("name", tags)} {content} {!!users.length && ( 2 ? users.length - 4 : 0} /> )} {!!startDate && ( {formatDate(startDate, "h:mm a")} {!!endDate && ( <> {" "} - {formatDate(endDate, "h:mm a")} > )} )} {!!location && ( {location} )} RSVP Details {image ? ( ) : ( )} ); } export function LoadingCard() { return ( ); }
{formatDate(startDate, "h:mm a")} {!!endDate && ( <> {" "} - {formatDate(endDate, "h:mm a")} > )}
{location}