Remove unused components and models for improved maintainability
- Deleted redundant components (`AddActionButton`, `AlertBox`, `AlertStack`, `BackButton`, `CancelButton`, and `CollapsableArea`) and related files. - Removed unused models (`Book`, `BookSerie`, `BookTables`, `Character`, and `Chapter`) to reduce codebase clutter. - Updated project structure and references to reflect these removals.
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import InputField from "@/components/form/InputField";
|
||||
import TexteAreaInput from "@/components/form/TexteAreaInput";
|
||||
import TextAreaInput from "@/components/form/TextAreaInput";
|
||||
import {ChangeEvent, Dispatch, SetStateAction, useContext, useEffect} from "react";
|
||||
import {faGuilded} from "@fortawesome/free-brands-svg-icons";
|
||||
import {Wand2} from "lucide-react";
|
||||
import {AlertContext} from "@/context/AlertContext";
|
||||
import System from "@/lib/models/System";
|
||||
import {apiGet} from "@/lib/api/client";
|
||||
import {SessionContext} from "@/context/SessionContext";
|
||||
import {BookContext} from "@/context/BookContext";
|
||||
import {LangContext, LangContextProps} from "@/context/LangContext";
|
||||
import {useTranslations} from "next-intl";
|
||||
import {useTranslations} from "@/lib/i18n";
|
||||
|
||||
interface GhostWriterSettingsProps {
|
||||
advancedPrompt: string;
|
||||
@@ -24,14 +24,14 @@ export default function GhostWriterSettings(
|
||||
const t = useTranslations();
|
||||
const {lang} = useContext<LangContextProps>(LangContext)
|
||||
const {book} = useContext(BookContext);
|
||||
|
||||
|
||||
useEffect((): void => {
|
||||
getAdvancedSettings().catch();
|
||||
}, []);
|
||||
|
||||
|
||||
async function getAdvancedSettings(): Promise<void> {
|
||||
try {
|
||||
const setting: string = await System.authGetQueryToServer<string>(`quillsense/ghostwriter/advanced-settings`, session.accessToken, lang, {
|
||||
const setting: string = await apiGet<string>(`quillsense/ghostwriter/advanced-settings`, session.accessToken, lang, {
|
||||
bookId: book?.bookId
|
||||
});
|
||||
if (setting) {
|
||||
@@ -45,14 +45,14 @@ export default function GhostWriterSettings(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<div className={`p-4 lg:p-5 space-y-5 overflow-y-auto flex-grow custom-scrollbar`}>
|
||||
<InputField input={<TexteAreaInput value={advancedPrompt}
|
||||
setValue={(e: ChangeEvent<HTMLTextAreaElement>): void => setAdvancedPrompt(e.target.value)}
|
||||
placeholder={`Information complémentaire pour la génération...`}
|
||||
maxLength={600}/>}
|
||||
fieldName={`Prompt additionnel`} icon={faGuilded}/>
|
||||
<InputField input={<TextAreaInput value={advancedPrompt}
|
||||
setValue={(e: ChangeEvent<HTMLTextAreaElement>): void => setAdvancedPrompt(e.target.value)}
|
||||
placeholder={`Information complémentaire pour la génération...`}
|
||||
maxLength={600}/>}
|
||||
fieldName={`Prompt additionnel`} icon={Wand2}/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user