export async function load({ fetch, params, parent }) {
	try {
		const response = await fetch(`/api/books/${params.bookId}`);
		const result = await response.json();
		let bookProgress = result.progress;

		return {
			bookProgress
		};
	} catch (error) {
		console.error('Error fetching book: ', error);
		return {
			status: error.status || 500,
			error: error.message
		};
	}
}
