import { ReactNode, FC } from "react";

import { useIdentityStore } from "../../features/Login/lib/identity.store";

interface AuthProviderProps {
	children: ReactNode;
}

export const UnauthorizedContextProvider: FC<AuthProviderProps> = ({
	children,
}) => {
	const user = useIdentityStore((x) => x.user);
	if (user) {
		return null;
	}

	return children;
};
