'use client'
import {useState} from "react";
import BookSettingSidebar from "@/components/book/settings/BookSettingSidebar";
import BookSettingOption from "@/components/book/settings/BookSettingOption";
import SettingsPanel from "@/components/SettingsPanel";
import {useTranslations} from "next-intl";

interface BookSettingProps {
    onClose: () => void;
}

export default function BookSetting({onClose}: BookSettingProps) {
    const t = useTranslations();
    const [currentSetting, setCurrentSetting] = useState<string>('basic-information');

    return (
        <SettingsPanel
            title={t("controllerBar.bookSettings")}
            sidebar={<BookSettingSidebar selectedSetting={currentSetting} setSelectedSetting={setCurrentSetting}/>}
            onClose={onClose}
        >
            <BookSettingOption setting={currentSetting}/>
        </SettingsPanel>
    );
}
