import { useEffect, useState } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faCrown } from "@fortawesome/free-solid-svg-icons"; import { CollectionIncludingMembersAndLinkCount } from "@/types/global"; import ProfilePhoto from "@/components/ProfilePhoto"; import getPublicUserData from "@/lib/client/getPublicUserData"; type Props = { collection: CollectionIncludingMembersAndLinkCount; }; export default function ViewTeam({ collection }: Props) { const [collectionOwner, setCollectionOwner] = useState({ id: null, name: "", username: "", image: "", }); useEffect(() => { const fetchOwner = async () => { const owner = await getPublicUserData(collection.ownerId as number); setCollectionOwner(owner); }; fetchOwner(); }, []); return (
Team
Here are all the members who are collaborating on this collection.
{collectionOwner.name}
@{collectionOwner.username}
{e.user.name}
@{e.user.username}