'use client';

import BookSettingsComponent from '@/components/BookSettings';
import { useProjectContext } from '@/providers/ProjectProvider';
import { useRouter } from 'next/navigation';

export default function SettingsPage() {
    const { project, updateProject, deleteProject } = useProjectContext();
    const router = useRouter();

    return (
        <BookSettingsComponent
            project={project}
            onUpdate={(updates) => updateProject(updates)}
            onDeleteProject={async () => {
                await deleteProject();
                router.push('/dashboard');
            }}
        />
    );
}
