import Title from "src/Title";
import useGetTitle from "src/useGetTitle";

export default function AvatarTitle({ avatarID }: { avatarID: string }) {
  const {
    data: { title, titleColor },
    isFetched: isTitleLoaded,
  } = useGetTitle(avatarID);

  if (!isTitleLoaded) {
    return null;
  }

  return <Title title={title} titleColor={titleColor} />;
}
