import React from "react"; import { Council, Member, Post, ProposalDetail, Thread } from "../../types"; import { domain } from "../../config"; import Summary from "./Summary"; import Posts from "./MemberPosts"; import Proposals from "./MemberProposals"; import NotFound from "./NotFound"; const MemberBox = (props: { match: { params: { handle: string } }; members: Member[]; councils: Council[]; proposals: ProposalDetail[]; posts: Post[]; threads: Thread[]; validators: string[]; history: any; status: { startTime: number }; }) => { const { councils, members, posts, proposals, status } = props; const h = props.match.params.handle; const member = members.find( (m) => m.handle === h || String(m.account) === h || m.id === Number(h) ); if (!member) return ; const council = status.council; const isCouncilMember = council?.consuls.find( (c) => c.member.handle === member.handle ); const threadTitle = (id: number) => { const thread = props.threads.find((t) => t.id === id); return thread ? thread.title : String(id); }; return (
{isCouncilMember &&
council member
}

{member.handle}

{member.account}
p && p.authorId === member.id)} startTime={status.startTime} /> p.authorId === member.account)} threadTitle={threadTitle} startTime={status.startTime} />
); }; export default MemberBox;