import { useRef, useState } from "react"; import { useNostrEvents, dateToUnix } from "nostr-react"; import NoteCard from '@/components/NoteCard'; import { Skeleton } from "@/components/ui/skeleton"; import { Button } from "@/components/ui/button"; import KIND20Card from "./KIND20Card"; import { getImageUrl } from "@/utils/utils"; interface ProfileFeedProps { pubkey: string; } const ProfileFeed: React.FC = ({ pubkey }) => { const now = useRef(new Date()); const [limit, setLimit] = useState(10); const { events, isLoading } = useNostrEvents({ filter: { authors: [pubkey], kinds: [20], limit: limit, }, }); const loadMore = () => { setLimit(prevLimit => prevLimit + 10); }; return ( <> {events.length === 0 && isLoading ? (
) : events.some(event => getImageUrl(event.tags)) ? ( <> {events.map((event) => { const imageUrl = getImageUrl(event.tags); return imageUrl ? ( ) : null; })} {!isLoading && (
)} ) : (

No posts found :(

)} ); } export default ProfileFeed;