import { Suspense } from 'react'; import { useAuthor } from './useAuthor'; import { useCurrentUser } from './useCurrentUser'; import { useLoginActions } from './useLoginActions'; import { useSocialFeed } from './useSocialFeed'; import type { NostrEvent } from '@nostrify/nostrify'; function App() { const { user, metadata } = useCurrentUser(); const login = useLoginActions(); function renderLogin() { if (user) { if (metadata.name) { return
Welcome back, {metadata.name}!
; } return
You: {user.pubkey}
; } return ( ); } return (

Login

{renderLogin()}

Notes

Loading...
}> ); } function Feed() { const feed = useSocialFeed(); return ( <> {feed.data?.map((note) => )} ); } function FeedPost({ event }: { event: NostrEvent }) { const author = useAuthor(event.pubkey); return (
{author.name ?? event.pubkey}
{event.content}
); } export default App;