-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathindex.tsx
65 lines (61 loc) · 2.12 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import SingleProfile from "@components/Shared/SingleProfile";
import { getAuthApiHeaders } from "@helpers/getAuthApiHeaders";
import { IS_MAINNET } from "@hey/data/constants";
import getInternalPreferences from "@hey/helpers/api/getInternalPreferences";
import type { Profile } from "@hey/lens";
import { useQuery } from "@tanstack/react-query";
import type { FC } from "react";
import LeafwatchDetails from "./LeafwatchDetails";
import ManagedProfiles from "./ManagedProfiles";
import Permissions from "./Permissions";
import ProfileOverview from "./ProfileOverview";
import ProfilePreferences from "./ProfilePreferences";
import Rank from "./Rank";
interface ProfileStaffToolProps {
profile: Profile;
}
const ProfileStaffTool: FC<ProfileStaffToolProps> = ({ profile }) => {
const { data: preferences } = useQuery({
queryFn: () => getInternalPreferences(profile.id, getAuthApiHeaders()),
queryKey: ["getInternalPreferences", profile.id || ""]
});
return (
<div>
<SingleProfile
hideFollowButton
hideUnfollowButton
isBig
linkToProfile
profile={profile}
showBio
showUserPreview={false}
/>
<ProfileOverview profile={profile} />
{preferences ? <ProfilePreferences preferences={preferences} /> : null}
{IS_MAINNET ? (
<>
<LeafwatchDetails profileId={profile.id} />
<div className="divider my-5 border-yellow-600 border-dashed" />
<Rank
address={profile.ownedBy.address}
handle={profile.handle?.localName}
lensClassifierScore={profile.stats.lensClassifierScore || 0}
profileId={profile.id}
/>
<div className="divider my-5 border-yellow-600 border-dashed" />
</>
) : null}
{preferences ? (
<>
<Permissions
permissions={preferences.permissions || []}
profileId={profile.id}
/>
<div className="divider my-5 border-yellow-600 border-dashed" />
</>
) : null}
<ManagedProfiles address={profile.ownedBy.address} />
</div>
);
};
export default ProfileStaffTool;