refactor(nextjs): image_type option remove from advance configuration
This commit is contained in:
parent
ba257cdfa6
commit
6ab451f2c1
5 changed files with 4 additions and 36 deletions
|
|
@ -159,7 +159,6 @@ const DocumentsPreviewPage: React.FC = () => {
|
|||
include_table_of_contents: !!config?.includeTableOfContents,
|
||||
include_title_slide: !!config?.includeTitleSlide,
|
||||
web_search: !!config?.webSearch,
|
||||
image_type: config?.imageType,
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ export class PresentationGenerationApi {
|
|||
include_table_of_contents,
|
||||
include_title_slide,
|
||||
web_search,
|
||||
image_type,
|
||||
|
||||
}: {
|
||||
content: string;
|
||||
n_slides: number | null;
|
||||
|
|
@ -72,7 +72,6 @@ export class PresentationGenerationApi {
|
|||
include_table_of_contents?: boolean;
|
||||
include_title_slide?: boolean;
|
||||
web_search?: boolean;
|
||||
image_type?: string | null;
|
||||
}) {
|
||||
try {
|
||||
const response = await fetch(
|
||||
|
|
@ -91,7 +90,6 @@ export class PresentationGenerationApi {
|
|||
include_table_of_contents,
|
||||
include_title_slide,
|
||||
web_search,
|
||||
image_type,
|
||||
}),
|
||||
cache: "no-cache",
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import {
|
|||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@/components/ui/select";
|
||||
import { ImageType, LanguageType, PresentationConfig, ToneType, VerbosityType } from "../type";
|
||||
import { LanguageType, PresentationConfig, ToneType, VerbosityType } from "../type";
|
||||
import { useState } from "react";
|
||||
import { Check, ChevronsUpDown, SlidersHorizontal } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
|
@ -201,7 +201,6 @@ export function ConfigurationSelects({
|
|||
const [advancedDraft, setAdvancedDraft] = useState({
|
||||
tone: config.tone,
|
||||
verbosity: config.verbosity,
|
||||
imageType: config.imageType,
|
||||
instructions: config.instructions,
|
||||
includeTableOfContents: config.includeTableOfContents,
|
||||
includeTitleSlide: config.includeTitleSlide,
|
||||
|
|
@ -213,7 +212,6 @@ export function ConfigurationSelects({
|
|||
setAdvancedDraft({
|
||||
tone: config.tone,
|
||||
verbosity: config.verbosity,
|
||||
imageType: config.imageType,
|
||||
instructions: config.instructions,
|
||||
includeTableOfContents: config.includeTableOfContents,
|
||||
includeTitleSlide: config.includeTitleSlide,
|
||||
|
|
@ -226,7 +224,6 @@ export function ConfigurationSelects({
|
|||
const handleSaveAdvanced = () => {
|
||||
onConfigChange("tone", advancedDraft.tone);
|
||||
onConfigChange("verbosity", advancedDraft.verbosity);
|
||||
onConfigChange("imageType", advancedDraft.imageType);
|
||||
onConfigChange("instructions", advancedDraft.instructions);
|
||||
onConfigChange("includeTableOfContents", advancedDraft.includeTableOfContents);
|
||||
onConfigChange("includeTitleSlide", advancedDraft.includeTitleSlide);
|
||||
|
|
@ -308,26 +305,7 @@ export function ConfigurationSelects({
|
|||
</Select>
|
||||
</div>
|
||||
|
||||
{/* Image Type */}
|
||||
<div className="w-full flex flex-col gap-2">
|
||||
<label className="text-sm font-semibold text-gray-700">Image type</label>
|
||||
<p className="text-xs text-gray-500">Choose whether images should be stock photos or AI-generated.</p>
|
||||
<Select
|
||||
value={advancedDraft.imageType}
|
||||
onValueChange={(value) => setAdvancedDraft((prev) => ({ ...prev, imageType: value as ImageType }))}
|
||||
>
|
||||
<SelectTrigger className="w-full font-instrument_sans capitalize font-medium bg-blue-100 border-blue-200 focus-visible:ring-blue-300">
|
||||
<SelectValue placeholder="Select image type" />
|
||||
</SelectTrigger>
|
||||
<SelectContent className="font-instrument_sans">
|
||||
{Object.values(ImageType).map((imageType) => (
|
||||
<SelectItem key={imageType} value={imageType} className="text-sm font-medium capitalize ">
|
||||
{imageType}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
|
||||
{/* Toggles */}
|
||||
<div className="w-full flex flex-col gap-2 p-3 rounded-md bg-blue-100 border-blue-200">
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import { useDispatch } from "react-redux";
|
|||
import { clearOutlines, setPresentationId } from "@/store/slices/presentationGeneration";
|
||||
import { ConfigurationSelects } from "./ConfigurationSelects";
|
||||
import { PromptInput } from "./PromptInput";
|
||||
import { ImageType, LanguageType, PresentationConfig, ToneType, VerbosityType } from "../type";
|
||||
import { LanguageType, PresentationConfig, ToneType, VerbosityType } from "../type";
|
||||
import SupportingDoc from "./SupportingDoc";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { ChevronRight } from "lucide-react";
|
||||
|
|
@ -49,7 +49,6 @@ const UploadPage = () => {
|
|||
prompt: "",
|
||||
tone: ToneType.Default,
|
||||
verbosity: VerbosityType.Standard,
|
||||
imageType: ImageType.Stock,
|
||||
instructions: "",
|
||||
includeTableOfContents: false,
|
||||
includeTitleSlide: false,
|
||||
|
|
@ -169,7 +168,6 @@ const UploadPage = () => {
|
|||
include_table_of_contents: !!config?.includeTableOfContents,
|
||||
include_title_slide: !!config?.includeTitleSlide,
|
||||
web_search: !!config?.webSearch,
|
||||
image_type: config?.imageType,
|
||||
});
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -124,7 +124,6 @@ export interface PresentationConfig {
|
|||
prompt: string;
|
||||
tone: ToneType;
|
||||
verbosity: VerbosityType;
|
||||
imageType: ImageType;
|
||||
instructions: string;
|
||||
includeTableOfContents: boolean;
|
||||
includeTitleSlide: boolean;
|
||||
|
|
@ -146,7 +145,3 @@ export enum VerbosityType {
|
|||
Text_Heavy = "text-heavy",
|
||||
}
|
||||
|
||||
export enum ImageType {
|
||||
Stock = "stock",
|
||||
AIGenerated = "ai-generated",
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue