diff --git a/src/components/Medium/InviteWithUserCard.tsx b/src/components/Medium/InviteWithUserCard.tsx index 158723f7..d0e14aac 100644 --- a/src/components/Medium/InviteWithUserCard.tsx +++ b/src/components/Medium/InviteWithUserCard.tsx @@ -1,4 +1,4 @@ -import {Invite, InviteWithUsers} from "@/interfaces/invite"; +import {Invite, InviteWithEntity} from "@/interfaces/invite"; import {User} from "@/interfaces/user"; import {getUserName} from "@/utils/users"; import axios from "axios"; @@ -7,14 +7,14 @@ import {BsArrowRepeat} from "react-icons/bs"; import {toast} from "react-toastify"; interface Props { - invite: InviteWithUsers; + invite: InviteWithEntity; reload: () => void; } export default function InviteWithUserCard({invite, reload}: Props) { const [isLoading, setIsLoading] = useState(false); - const name = useMemo(() => (!invite.from ? null : getUserName(invite.from)), [invite.from]); + const name = useMemo(() => (!invite.entity ? null : invite.entity.label), [invite.entity]); const decide = (decision: "accept" | "decline") => { if (!confirm(`Are you sure you want to ${decision} this invite?`)) return; @@ -37,7 +37,7 @@ export default function InviteWithUserCard({invite, reload}: Props) { return (
- Invited by {name} + Invited to {name}