Something went wrong. Try again.
A Bsky-like frontend using the atprotocol natively.
Something went wrong. Try again.
636 B · 22 lines
TSX
at main
1234567891011121314151617181920212223import { useState, useCallback } from 'react';import { ProfileViewerContext } from './profileViewerContext';
export { ProfileViewerContext } from './profileViewerContext';
export function ProfileViewerProvider({ children }: { children: React.ReactNode }) { const [activeActor, setActiveActor] = useState<string | null>(null);
const open = useCallback((actor: string) => { setActiveActor(actor); }, []);
const close = useCallback(() => { setActiveActor(null); }, []);
return ( <ProfileViewerContext.Provider value={{ activeActor, open, close }}> {children} </ProfileViewerContext.Provider> );}