'use client';

import { useEffect } from 'react';

import { useRouter } from 'next/navigation.js';

import { useNitrogenData } from './useNitrogenData.js';

// TODO: This needs to take props for registering server-side modules
// Probably register a module through the singleton getNitrogenData class then pass it to this function as a prop or through a hook. Whichever is easier.

export default function NitrogenClient() {
	const data = useNitrogenData({
		type: 'page',
		id: '123',
	});
	const router = useRouter();

	useEffect(() => {
		console.log('calling router.refresh');
		router.refresh();
	}, [data]);

	return null;
}
