From 4b016c908dda2019f3bf89e5a3d2eae535e5fbd2 Mon Sep 17 00:00:00 2001 From: polwex Date: Thu, 18 Sep 2025 00:24:39 +0700 Subject: oioi --- front/src/components/profile/Profile.tsx | 67 ++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 front/src/components/profile/Profile.tsx (limited to 'front/src/components/profile/Profile.tsx') diff --git a/front/src/components/profile/Profile.tsx b/front/src/components/profile/Profile.tsx new file mode 100644 index 0000000..b5f22e9 --- /dev/null +++ b/front/src/components/profile/Profile.tsx @@ -0,0 +1,67 @@ +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; -- cgit v1.2.3