export const usePortalTags = () => {
  const { fetchUser, setUser } = useDirectusAuth();
  const user = useDirectusUser();

  const tags = computed(() => (toValue(user)?.tags as Array<string>) || []);

  const details = computed(() => {
    const value = toValue(tags);

    return {
      interest: value.includes("portal-interest"),
    };
  });

  onBeforeMount(async () => {
    if (!user.value) {
      const user = await fetchUser();
      setUser(user.value);
    }
  });

  return details;
};
