From b038eef922909b06092e3545e7e3dfb8c886b7e0 Mon Sep 17 00:00:00 2001 From: Priyank Kumar Mishra Date: Thu, 31 Oct 2024 20:32:30 +0530 Subject: [PATCH 1/2] Added raw code view --- components/pages/CreateProjectReadmePage.tsx | 41 ++++++++++++++++++-- package-lock.json | 10 +++++ package.json | 1 + 3 files changed, 48 insertions(+), 4 deletions(-) diff --git a/components/pages/CreateProjectReadmePage.tsx b/components/pages/CreateProjectReadmePage.tsx index 7c97750..dd62b86 100644 --- a/components/pages/CreateProjectReadmePage.tsx +++ b/components/pages/CreateProjectReadmePage.tsx @@ -6,10 +6,11 @@ import { useToast } from "../ui/use-toast"; import { projectReadmeFormData } from "@/types"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../ui/select"; import { Button } from "../ui/button"; -import { Check, CopyIcon } from "lucide-react"; +import { Check, CopyIcon, GripVertical } from "lucide-react"; import RenderMarkdown from "../RenderMarkdown"; import CreateProjectReadmeForm from "../CreateProejctReadme"; import { GenerateContentWithAI } from "@/actions/AIGeneration"; +import {Panel, PanelGroup, PanelResizeHandle } from 'react-resizable-panels'; type Props = { themeFiles: string[]; @@ -29,6 +30,7 @@ const CreateProjectReadmePage = ({ themeFiles, markdownPath }: Props) => { }); const [themeContent, setThemeContent] = useState(""); const [isCopied, setIsCopied] = useState(false); + const [isRawMode, setIsRawMode] = useState(false); const [generating, setGenerating] = useState(false); const getThemeData = async () => { @@ -56,6 +58,10 @@ const CreateProjectReadmePage = ({ themeFiles, markdownPath }: Props) => { setIsCopied(false); }, 2000) } + + const handleMarkdownChange = (e:React.ChangeEvent)=>{ + setThemeContent(e.target.value); + } const getAIText = async () => { setGenerating(true); @@ -68,7 +74,7 @@ const CreateProjectReadmePage = ({ themeFiles, markdownPath }: Props) => { return (
-
+
+
- - + + +
+ +
+
+ {isRawMode ? ( + <> + +
+ +
+
+ +
+