import "@/styles/Profile.css"; import type { UserProfile, UserType } from "@/types/nostrill"; import useLocalState from "@/state/state"; import Avatar from "../Avatar"; import ProfileEditor from "./Editor"; interface Props { user: UserType; userString: string; isMe: boolean; onSave?: () => void; } const Loader: React.FC = (props) => { const { profiles } = useLocalState((s) => ({ profiles: s.profiles, })); const profile = profiles.get(props.userString); if (props.isMe) return ; else return ; }; function Profile({ user, userString, profile, }: { user: UserType; userString: string; profile: UserProfile | undefined; }) { // Initialize state with existing profile or defaults // View-only mode for other users' profiles - no editing allowed const customFields = profile?.other ? Object.entries(profile.other) : []; return (

{profile?.name || userString}

{profile?.about &&

{profile.about}

} {customFields.length > 0 && (

Additional Info

{customFields.map(([key, value], index) => (
{key}: {value}
))}
)}
); } export default Loader;