From 36bbefa5aab8244680e5743216737c1451d93cf3 Mon Sep 17 00:00:00 2001 From: Suraj Jha Date: Sat, 9 Aug 2025 19:42:21 +0545 Subject: [PATCH] fix: change 'layout' to 'layout' --- .../components/EachSlide.tsx | 0 .../components/EachSlide/EditControls.tsx | 0 .../components/EachSlide/HtmlEditor.tsx | 0 .../components/EachSlide/NewEachSlide.tsx | 0 .../components/EachSlide/SlideActions.tsx | 0 .../EachSlide/SlideContentDisplay.tsx | 0 .../components/FileUploadSection.tsx | 0 .../components/FontManager.tsx | 0 .../components/LoadingSpinner.tsx | 0 .../components/OpenAIKeyWarning.tsx | 18 ++++++ .../components/SaveLayoutButton.tsx | 4 +- .../components/SaveLayoutModal.tsx | 12 ++-- .../components/SlideContent.tsx | 0 .../hooks/useCustomLayout.ts | 0 .../hooks/useDrawingCanvas.ts | 0 .../hooks/useFileUpload.ts | 0 .../hooks/useFontManagement.ts | 0 .../hooks/useHtmlEdit.ts | 0 .../hooks/useLayoutSaving.ts | 0 .../hooks/useOpenAIKeyCheck.ts | 18 ++++++ .../hooks/useSlideEdit.ts | 0 .../hooks/useSlideProcessing.ts | 0 .../page.tsx | 4 +- .../types/index.ts | 0 .../dashboard/components/Header.tsx | 4 +- .../outline/components/GenerateButton.tsx | 2 +- .../outline/components/LayoutSelection.tsx | 4 +- .../outline/components/OutlinePage.tsx | 2 +- .../[slug]/page.tsx | 4 +- .../components/LoadingStates.tsx | 0 .../hooks/useGroupLayoutLoader.ts | 0 .../hooks/useLayoutLoader.ts | 27 ++++----- .../page.tsx | 2 +- .../types/index.ts | 0 .../nextjs/app/api/has-openai-key/route.ts | 25 ++++++++ servers/nextjs/app/api/layouts/route.ts | 2 +- servers/nextjs/app/api/template/route.ts | 60 +++++++++++++++++++ servers/nextjs/app/api/templates/route.ts | 57 ++++++++++++++++++ servers/nextjs/components/Header.tsx | 46 +++++--------- 39 files changed, 224 insertions(+), 67 deletions(-) rename servers/nextjs/app/(presentation-generator)/{custom-layout => custom-template}/components/EachSlide.tsx (100%) rename servers/nextjs/app/(presentation-generator)/{custom-layout => custom-template}/components/EachSlide/EditControls.tsx (100%) rename servers/nextjs/app/(presentation-generator)/{custom-layout => custom-template}/components/EachSlide/HtmlEditor.tsx (100%) rename servers/nextjs/app/(presentation-generator)/{custom-layout => custom-template}/components/EachSlide/NewEachSlide.tsx (100%) rename servers/nextjs/app/(presentation-generator)/{custom-layout => custom-template}/components/EachSlide/SlideActions.tsx (100%) rename servers/nextjs/app/(presentation-generator)/{custom-layout => custom-template}/components/EachSlide/SlideContentDisplay.tsx (100%) rename servers/nextjs/app/(presentation-generator)/{custom-layout => custom-template}/components/FileUploadSection.tsx (100%) rename servers/nextjs/app/(presentation-generator)/{custom-layout => custom-template}/components/FontManager.tsx (100%) rename servers/nextjs/app/(presentation-generator)/{custom-layout => custom-template}/components/LoadingSpinner.tsx (100%) create mode 100644 servers/nextjs/app/(presentation-generator)/custom-template/components/OpenAIKeyWarning.tsx rename servers/nextjs/app/(presentation-generator)/{custom-layout => custom-template}/components/SaveLayoutButton.tsx (94%) rename servers/nextjs/app/(presentation-generator)/{custom-layout => custom-template}/components/SaveLayoutModal.tsx (91%) rename servers/nextjs/app/(presentation-generator)/{custom-layout => custom-template}/components/SlideContent.tsx (100%) rename servers/nextjs/app/(presentation-generator)/{custom-layout => custom-template}/hooks/useCustomLayout.ts (100%) rename servers/nextjs/app/(presentation-generator)/{custom-layout => custom-template}/hooks/useDrawingCanvas.ts (100%) rename servers/nextjs/app/(presentation-generator)/{custom-layout => custom-template}/hooks/useFileUpload.ts (100%) rename servers/nextjs/app/(presentation-generator)/{custom-layout => custom-template}/hooks/useFontManagement.ts (100%) rename servers/nextjs/app/(presentation-generator)/{custom-layout => custom-template}/hooks/useHtmlEdit.ts (100%) rename servers/nextjs/app/(presentation-generator)/{custom-layout => custom-template}/hooks/useLayoutSaving.ts (100%) create mode 100644 servers/nextjs/app/(presentation-generator)/custom-template/hooks/useOpenAIKeyCheck.ts rename servers/nextjs/app/(presentation-generator)/{custom-layout => custom-template}/hooks/useSlideEdit.ts (100%) rename servers/nextjs/app/(presentation-generator)/{custom-layout => custom-template}/hooks/useSlideProcessing.ts (100%) rename servers/nextjs/app/(presentation-generator)/{custom-layout => custom-template}/page.tsx (98%) rename servers/nextjs/app/(presentation-generator)/{custom-layout => custom-template}/types/index.ts (100%) rename servers/nextjs/app/(presentation-generator)/{layout-preview => template-preview}/[slug]/page.tsx (98%) rename servers/nextjs/app/(presentation-generator)/{layout-preview => template-preview}/components/LoadingStates.tsx (100%) rename servers/nextjs/app/(presentation-generator)/{layout-preview => template-preview}/hooks/useGroupLayoutLoader.ts (100%) rename servers/nextjs/app/(presentation-generator)/{layout-preview => template-preview}/hooks/useLayoutLoader.ts (84%) rename servers/nextjs/app/(presentation-generator)/{layout-preview => template-preview}/page.tsx (98%) rename servers/nextjs/app/(presentation-generator)/{layout-preview => template-preview}/types/index.ts (100%) create mode 100644 servers/nextjs/app/api/has-openai-key/route.ts create mode 100644 servers/nextjs/app/api/template/route.ts create mode 100644 servers/nextjs/app/api/templates/route.ts diff --git a/servers/nextjs/app/(presentation-generator)/custom-layout/components/EachSlide.tsx b/servers/nextjs/app/(presentation-generator)/custom-template/components/EachSlide.tsx similarity index 100% rename from servers/nextjs/app/(presentation-generator)/custom-layout/components/EachSlide.tsx rename to servers/nextjs/app/(presentation-generator)/custom-template/components/EachSlide.tsx diff --git a/servers/nextjs/app/(presentation-generator)/custom-layout/components/EachSlide/EditControls.tsx b/servers/nextjs/app/(presentation-generator)/custom-template/components/EachSlide/EditControls.tsx similarity index 100% rename from servers/nextjs/app/(presentation-generator)/custom-layout/components/EachSlide/EditControls.tsx rename to servers/nextjs/app/(presentation-generator)/custom-template/components/EachSlide/EditControls.tsx diff --git a/servers/nextjs/app/(presentation-generator)/custom-layout/components/EachSlide/HtmlEditor.tsx b/servers/nextjs/app/(presentation-generator)/custom-template/components/EachSlide/HtmlEditor.tsx similarity index 100% rename from servers/nextjs/app/(presentation-generator)/custom-layout/components/EachSlide/HtmlEditor.tsx rename to servers/nextjs/app/(presentation-generator)/custom-template/components/EachSlide/HtmlEditor.tsx diff --git a/servers/nextjs/app/(presentation-generator)/custom-layout/components/EachSlide/NewEachSlide.tsx b/servers/nextjs/app/(presentation-generator)/custom-template/components/EachSlide/NewEachSlide.tsx similarity index 100% rename from servers/nextjs/app/(presentation-generator)/custom-layout/components/EachSlide/NewEachSlide.tsx rename to servers/nextjs/app/(presentation-generator)/custom-template/components/EachSlide/NewEachSlide.tsx diff --git a/servers/nextjs/app/(presentation-generator)/custom-layout/components/EachSlide/SlideActions.tsx b/servers/nextjs/app/(presentation-generator)/custom-template/components/EachSlide/SlideActions.tsx similarity index 100% rename from servers/nextjs/app/(presentation-generator)/custom-layout/components/EachSlide/SlideActions.tsx rename to servers/nextjs/app/(presentation-generator)/custom-template/components/EachSlide/SlideActions.tsx diff --git a/servers/nextjs/app/(presentation-generator)/custom-layout/components/EachSlide/SlideContentDisplay.tsx b/servers/nextjs/app/(presentation-generator)/custom-template/components/EachSlide/SlideContentDisplay.tsx similarity index 100% rename from servers/nextjs/app/(presentation-generator)/custom-layout/components/EachSlide/SlideContentDisplay.tsx rename to servers/nextjs/app/(presentation-generator)/custom-template/components/EachSlide/SlideContentDisplay.tsx diff --git a/servers/nextjs/app/(presentation-generator)/custom-layout/components/FileUploadSection.tsx b/servers/nextjs/app/(presentation-generator)/custom-template/components/FileUploadSection.tsx similarity index 100% rename from servers/nextjs/app/(presentation-generator)/custom-layout/components/FileUploadSection.tsx rename to servers/nextjs/app/(presentation-generator)/custom-template/components/FileUploadSection.tsx diff --git a/servers/nextjs/app/(presentation-generator)/custom-layout/components/FontManager.tsx b/servers/nextjs/app/(presentation-generator)/custom-template/components/FontManager.tsx similarity index 100% rename from servers/nextjs/app/(presentation-generator)/custom-layout/components/FontManager.tsx rename to servers/nextjs/app/(presentation-generator)/custom-template/components/FontManager.tsx diff --git a/servers/nextjs/app/(presentation-generator)/custom-layout/components/LoadingSpinner.tsx b/servers/nextjs/app/(presentation-generator)/custom-template/components/LoadingSpinner.tsx similarity index 100% rename from servers/nextjs/app/(presentation-generator)/custom-layout/components/LoadingSpinner.tsx rename to servers/nextjs/app/(presentation-generator)/custom-template/components/LoadingSpinner.tsx diff --git a/servers/nextjs/app/(presentation-generator)/custom-template/components/OpenAIKeyWarning.tsx b/servers/nextjs/app/(presentation-generator)/custom-template/components/OpenAIKeyWarning.tsx new file mode 100644 index 00000000..0dd7aaa2 --- /dev/null +++ b/servers/nextjs/app/(presentation-generator)/custom-template/components/OpenAIKeyWarning.tsx @@ -0,0 +1,18 @@ +import React from "react"; +import Header from "@/components/Header"; + +export const OpenAIKeyWarning: React.FC = () => { + return ( +
+
+
+
+

Please add your OpenAI API Key to process the layout

+

+ This feature requires an OpenAI model GPT-5. Configure your key in settings or via environment variables. +

+
+
+
+ ); +}; \ No newline at end of file diff --git a/servers/nextjs/app/(presentation-generator)/custom-layout/components/SaveLayoutButton.tsx b/servers/nextjs/app/(presentation-generator)/custom-template/components/SaveLayoutButton.tsx similarity index 94% rename from servers/nextjs/app/(presentation-generator)/custom-layout/components/SaveLayoutButton.tsx rename to servers/nextjs/app/(presentation-generator)/custom-template/components/SaveLayoutButton.tsx index 9123b912..6badcf5b 100644 --- a/servers/nextjs/app/(presentation-generator)/custom-layout/components/SaveLayoutButton.tsx +++ b/servers/nextjs/app/(presentation-generator)/custom-template/components/SaveLayoutButton.tsx @@ -25,12 +25,12 @@ export const SaveLayoutButton: React.FC = ({ {isSaving ? ( <> - Saving Layout... + Saving Template... ) : ( <> - Save Layout + Save Template )} diff --git a/servers/nextjs/app/(presentation-generator)/custom-layout/components/SaveLayoutModal.tsx b/servers/nextjs/app/(presentation-generator)/custom-template/components/SaveLayoutModal.tsx similarity index 91% rename from servers/nextjs/app/(presentation-generator)/custom-layout/components/SaveLayoutModal.tsx rename to servers/nextjs/app/(presentation-generator)/custom-template/components/SaveLayoutModal.tsx index 57924e7a..40fa3a89 100644 --- a/servers/nextjs/app/(presentation-generator)/custom-layout/components/SaveLayoutModal.tsx +++ b/servers/nextjs/app/(presentation-generator)/custom-template/components/SaveLayoutModal.tsx @@ -53,22 +53,22 @@ export const SaveLayoutModal: React.FC = ({ - Save Layout + Save Template - Enter a name and description for your layout. This will help you identify it later. + Enter a name and description for your template. This will help you identify it later.
setLayoutName(e.target.value)} - placeholder="Enter layout name..." + placeholder="Enter template name..." disabled={isSaving} className="w-full" /> @@ -81,7 +81,7 @@ export const SaveLayoutModal: React.FC = ({ id="description" value={description} onChange={(e) => setDescription(e.target.value)} - placeholder="Enter a description for your layout..." + placeholder="Enter a description for your template..." disabled={isSaving} className="w-full resize-none" rows={3} @@ -109,7 +109,7 @@ export const SaveLayoutModal: React.FC = ({ ) : ( <> - Save Layout + Save Template )} diff --git a/servers/nextjs/app/(presentation-generator)/custom-layout/components/SlideContent.tsx b/servers/nextjs/app/(presentation-generator)/custom-template/components/SlideContent.tsx similarity index 100% rename from servers/nextjs/app/(presentation-generator)/custom-layout/components/SlideContent.tsx rename to servers/nextjs/app/(presentation-generator)/custom-template/components/SlideContent.tsx diff --git a/servers/nextjs/app/(presentation-generator)/custom-layout/hooks/useCustomLayout.ts b/servers/nextjs/app/(presentation-generator)/custom-template/hooks/useCustomLayout.ts similarity index 100% rename from servers/nextjs/app/(presentation-generator)/custom-layout/hooks/useCustomLayout.ts rename to servers/nextjs/app/(presentation-generator)/custom-template/hooks/useCustomLayout.ts diff --git a/servers/nextjs/app/(presentation-generator)/custom-layout/hooks/useDrawingCanvas.ts b/servers/nextjs/app/(presentation-generator)/custom-template/hooks/useDrawingCanvas.ts similarity index 100% rename from servers/nextjs/app/(presentation-generator)/custom-layout/hooks/useDrawingCanvas.ts rename to servers/nextjs/app/(presentation-generator)/custom-template/hooks/useDrawingCanvas.ts diff --git a/servers/nextjs/app/(presentation-generator)/custom-layout/hooks/useFileUpload.ts b/servers/nextjs/app/(presentation-generator)/custom-template/hooks/useFileUpload.ts similarity index 100% rename from servers/nextjs/app/(presentation-generator)/custom-layout/hooks/useFileUpload.ts rename to servers/nextjs/app/(presentation-generator)/custom-template/hooks/useFileUpload.ts diff --git a/servers/nextjs/app/(presentation-generator)/custom-layout/hooks/useFontManagement.ts b/servers/nextjs/app/(presentation-generator)/custom-template/hooks/useFontManagement.ts similarity index 100% rename from servers/nextjs/app/(presentation-generator)/custom-layout/hooks/useFontManagement.ts rename to servers/nextjs/app/(presentation-generator)/custom-template/hooks/useFontManagement.ts diff --git a/servers/nextjs/app/(presentation-generator)/custom-layout/hooks/useHtmlEdit.ts b/servers/nextjs/app/(presentation-generator)/custom-template/hooks/useHtmlEdit.ts similarity index 100% rename from servers/nextjs/app/(presentation-generator)/custom-layout/hooks/useHtmlEdit.ts rename to servers/nextjs/app/(presentation-generator)/custom-template/hooks/useHtmlEdit.ts diff --git a/servers/nextjs/app/(presentation-generator)/custom-layout/hooks/useLayoutSaving.ts b/servers/nextjs/app/(presentation-generator)/custom-template/hooks/useLayoutSaving.ts similarity index 100% rename from servers/nextjs/app/(presentation-generator)/custom-layout/hooks/useLayoutSaving.ts rename to servers/nextjs/app/(presentation-generator)/custom-template/hooks/useLayoutSaving.ts diff --git a/servers/nextjs/app/(presentation-generator)/custom-template/hooks/useOpenAIKeyCheck.ts b/servers/nextjs/app/(presentation-generator)/custom-template/hooks/useOpenAIKeyCheck.ts new file mode 100644 index 00000000..8263ddd9 --- /dev/null +++ b/servers/nextjs/app/(presentation-generator)/custom-template/hooks/useOpenAIKeyCheck.ts @@ -0,0 +1,18 @@ +import { useState, useEffect } from "react"; + +export const useOpenAIKeyCheck = () => { + const [hasOpenAIKey, setHasOpenAIKey] = useState(false); + const [isOpenAIKeyLoading, setIsOpenAIKeyLoading] = useState(true); + + useEffect(() => { + fetch("/api/has-openai-key") + .then((res) => res.json()) + .then((data) => { + setHasOpenAIKey(Boolean(data.hasKey)); + setIsOpenAIKeyLoading(false); + }) + .catch(() => setIsOpenAIKeyLoading(false)); + }, []); + + return { hasOpenAIKey, isOpenAIKeyLoading }; +}; \ No newline at end of file diff --git a/servers/nextjs/app/(presentation-generator)/custom-layout/hooks/useSlideEdit.ts b/servers/nextjs/app/(presentation-generator)/custom-template/hooks/useSlideEdit.ts similarity index 100% rename from servers/nextjs/app/(presentation-generator)/custom-layout/hooks/useSlideEdit.ts rename to servers/nextjs/app/(presentation-generator)/custom-template/hooks/useSlideEdit.ts diff --git a/servers/nextjs/app/(presentation-generator)/custom-layout/hooks/useSlideProcessing.ts b/servers/nextjs/app/(presentation-generator)/custom-template/hooks/useSlideProcessing.ts similarity index 100% rename from servers/nextjs/app/(presentation-generator)/custom-layout/hooks/useSlideProcessing.ts rename to servers/nextjs/app/(presentation-generator)/custom-template/hooks/useSlideProcessing.ts diff --git a/servers/nextjs/app/(presentation-generator)/custom-layout/page.tsx b/servers/nextjs/app/(presentation-generator)/custom-template/page.tsx similarity index 98% rename from servers/nextjs/app/(presentation-generator)/custom-layout/page.tsx rename to servers/nextjs/app/(presentation-generator)/custom-template/page.tsx index eabe6e06..63dc95f1 100644 --- a/servers/nextjs/app/(presentation-generator)/custom-layout/page.tsx +++ b/servers/nextjs/app/(presentation-generator)/custom-template/page.tsx @@ -125,7 +125,7 @@ const CustomLayoutPage = () => {
)} - {/* Floating Save Layout Button */} + {/* Floating Save Template Button */} {slides.length > 0 && slides.some((s) => s.processed) && ( { /> )} - {/* Save Layout Modal */} + {/* Save Template Modal */} {
- Layouts + Templates
diff --git a/servers/nextjs/app/(presentation-generator)/outline/components/GenerateButton.tsx b/servers/nextjs/app/(presentation-generator)/outline/components/GenerateButton.tsx index e5f37757..329a5ef1 100644 --- a/servers/nextjs/app/(presentation-generator)/outline/components/GenerateButton.tsx +++ b/servers/nextjs/app/(presentation-generator)/outline/components/GenerateButton.tsx @@ -23,7 +23,7 @@ const GenerateButton: React.FC = ({ const getButtonText = () => { if (loadingState.isLoading) return loadingState.message; if (streamState.isLoading || streamState.isStreaming) return "Loading..."; - if (!selectedLayoutGroup) return "Select a Layout Style"; + if (!selectedLayoutGroup) return "Select a Templae"; return "Generate Presentation"; }; diff --git a/servers/nextjs/app/(presentation-generator)/outline/components/LayoutSelection.tsx b/servers/nextjs/app/(presentation-generator)/outline/components/LayoutSelection.tsx index 0824fa1c..e5538cff 100644 --- a/servers/nextjs/app/(presentation-generator)/outline/components/LayoutSelection.tsx +++ b/servers/nextjs/app/(presentation-generator)/outline/components/LayoutSelection.tsx @@ -82,10 +82,10 @@ const LayoutSelection: React.FC = ({
- No Layout Styles Available + No Templates Available

- No presentation layout styles could be loaded. Please try refreshing the page. + No presentation templates could be loaded. Please try refreshing the page.

diff --git a/servers/nextjs/app/(presentation-generator)/outline/components/OutlinePage.tsx b/servers/nextjs/app/(presentation-generator)/outline/components/OutlinePage.tsx index eceb950b..c11a5a59 100644 --- a/servers/nextjs/app/(presentation-generator)/outline/components/OutlinePage.tsx +++ b/servers/nextjs/app/(presentation-generator)/outline/components/OutlinePage.tsx @@ -51,7 +51,7 @@ const OutlinePage: React.FC = () => { Outline & Content - Layout Style + Select Template
diff --git a/servers/nextjs/app/(presentation-generator)/layout-preview/[slug]/page.tsx b/servers/nextjs/app/(presentation-generator)/template-preview/[slug]/page.tsx similarity index 98% rename from servers/nextjs/app/(presentation-generator)/layout-preview/[slug]/page.tsx rename to servers/nextjs/app/(presentation-generator)/template-preview/[slug]/page.tsx index 22570da2..f54e7abd 100644 --- a/servers/nextjs/app/(presentation-generator)/layout-preview/[slug]/page.tsx +++ b/servers/nextjs/app/(presentation-generator)/template-preview/[slug]/page.tsx @@ -44,7 +44,7 @@ const GroupLayoutPreview = () => { method: "DELETE", }); if (response.ok) { - router.push("/layout-preview"); + router.push("/template-preview"); } } return ( @@ -66,7 +66,7 @@ const GroupLayoutPreview = () => {