Add components for Act management and integrate Electron setup
This commit is contained in:
33
components/editor/ScribeEditor.tsx
Normal file
33
components/editor/ScribeEditor.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import React, {useContext, useState} from "react";
|
||||
import {ChapterContext} from "@/context/ChapterContext";
|
||||
import {BookContext} from "@/context/BookContext";
|
||||
import {SettingBookContext} from "@/context/SettingBookContext";
|
||||
import TextEditor from "./TextEditor";
|
||||
import BookList from "@/components/book/BookList";
|
||||
import BookSettingOption from "@/components/book/settings/BookSettingOption";
|
||||
import NoBookHome from "@/components/editor/NoBookHome";
|
||||
|
||||
export default function ScribeEditor() {
|
||||
const {chapter} = useContext(ChapterContext);
|
||||
const {book} = useContext(BookContext);
|
||||
|
||||
const [bookSettingId, setBookSettingId] = useState<string>('');
|
||||
|
||||
return (
|
||||
<SettingBookContext.Provider value={{bookSettingId, setBookSettingId}}>
|
||||
<div className="flex-1 bg-darkest-background">
|
||||
{
|
||||
chapter ? (
|
||||
<TextEditor/>
|
||||
) : book ? (
|
||||
<NoBookHome/>
|
||||
) : book === null ? (
|
||||
<BookList/>
|
||||
) : bookSettingId && (
|
||||
<BookSettingOption setting={bookSettingId}/>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
</SettingBookContext.Provider>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user