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 { toast } from "react-hot-toast"; import getPublicUserData from "@/lib/client/getPublicUserData"; type Props = { collection: CollectionIncludingMembersAndLinkCount; }; export default function ViewTeam({ collection }: Props) { const currentURL = new URL(document.URL); const publicCollectionURL = `${currentURL.origin}/public/collections/${collection.id}`; 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's all the members that are collaborating in this collection.
{collectionOwner.name}
@{collectionOwner.username}
{e.user.name}
@{e.user.username}