TwitchClone / src / utils / helpers / userToUserProfile / index.tsx
index.tsx
Raw
// import { useEffect, useState } from "react";
import { UserProfile } from "../../../types/notifications";
import { User } from "../../../types/user";
import { api } from "../../api";

export default function userToUserProfile(
  user: User | undefined
): UserProfile | undefined {
  // const [fullUser, setFullUser] = useState<UserProfile | undefined>(undefined);
  if (!user) {
    return undefined;
  }
  //type mismatch, need to fix
  // const data_ = api.lambda.getUserInfo.useQuery({ email: user.email });

  const userData = {
    ...user,
    name: user.username,
    password: "drowssap",
    messages: [],
  };
  return userData;
}