From c246ccc3d1d82089a33a73485d09e87ca5040801 Mon Sep 17 00:00:00 2001 From: Sumit Jain Date: Fri, 20 Dec 2024 12:51:29 +0530 Subject: [PATCH 1/8] feat: update Commit Docs Page and related components for improved guest access and icon support --- .../commit_docs_page/commit_docs_page.json | 262 +++++++++--------- .../commit_docs_page/commit_docs_page.py | 2 +- .../commit_docs_topbar_item.json | 3 +- commit/www/commit.py | 6 +- 4 files changed, 136 insertions(+), 137 deletions(-) diff --git a/commit/commit/doctype/commit_docs_page/commit_docs_page.json b/commit/commit/doctype/commit_docs_page/commit_docs_page.json index 4110d98..989f952 100644 --- a/commit/commit/doctype/commit_docs_page/commit_docs_page.json +++ b/commit/commit/doctype/commit_docs_page/commit_docs_page.json @@ -1,133 +1,133 @@ { - "actions": [], - "allow_rename": 1, - "autoname": "format:{title}-{route}", - "creation": "2024-10-29 19:39:29.842455", - "doctype": "DocType", - "engine": "InnoDB", - "field_order": [ - "title", - "route", - "published", - "allow_guest", - "icon", - "column_break_sedp", - "badge", - "badge_color", - "is_group_page", - "documentation_section", - "content", - "section_break_twyn", - "linked_pages" - ], - "fields": [ - { - "fieldname": "title", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Title", - "reqd": 1 - }, - { - "fieldname": "route", - "fieldtype": "Data", - "in_list_view": 1, - "in_preview": 1, - "in_standard_filter": 1, - "label": "Route", - "reqd": 1, - "unique": 1 - }, - { - "default": "1", - "fieldname": "published", - "fieldtype": "Check", - "label": "Published" - }, - { - "default": "1", - "fieldname": "allow_guest", - "fieldtype": "Check", - "label": "Allow Guest" - }, - { - "depends_on": "eval:doc.is_group_page == 0", - "fieldname": "content", - "fieldtype": "Markdown Editor", - "ignore_xss_filter": 1, - "label": "Content" - }, - { - "description": "This is badge field, eg: GET , POST etc.", - "fieldname": "badge", - "fieldtype": "Data", - "label": "Badge" - }, - { - "description": "Add Tailwind colours like red, green, blue, yellow, purple, pink, indigo, cyan, teal, lime, orange, gray etc.", - "fieldname": "badge_color", - "fieldtype": "Data", - "label": "Badge Color" - }, - { - "fieldname": "column_break_sedp", - "fieldtype": "Column Break" - }, - { - "default": "0", - "description": "When enabled, this page can hold and display nested sub-pages, creating a structured hierarchy in the sidebar.", - "fieldname": "is_group_page", - "fieldtype": "Check", - "label": "Is Group Page" - }, - { - "fieldname": "documentation_section", - "fieldtype": "Section Break", - "label": "Documentation" - }, - { - "description": "\"Supports only icons from the react-icons library. Enter the icon name in the format 'libraryPrefix/IconName' (e.g., 'Fa/FaFileExcel') to display it beside the title in the sidebar.\"\n", - "documentation_url": "https://react-icons.github.io/react-icons/search/", - "fieldname": "icon", - "fieldtype": "Data", - "label": "Icon" - }, - { - "fieldname": "section_break_twyn", - "fieldtype": "Section Break" - }, - { - "depends_on": "eval:doc.is_group_page == 1", - "fieldname": "linked_pages", - "fieldtype": "Table", - "label": "Linked Pages", - "options": "Linked Commit Docs Page" - } - ], - "index_web_pages_for_search": 1, - "links": [], - "modified": "2024-11-15 15:20:42.503563", - "modified_by": "Administrator", - "module": "commit", - "name": "Commit Docs Page", - "naming_rule": "Expression", - "owner": "Administrator", - "permissions": [ - { - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "share": 1, - "write": 1 - } - ], - "sort_field": "creation", - "sort_order": "DESC", - "states": [], - "title_field": "title" + "actions": [], + "allow_rename": 1, + "autoname": "format:{title}-{route}", + "creation": "2024-10-29 19:39:29.842455", + "doctype": "DocType", + "engine": "InnoDB", + "field_order": [ + "title", + "route", + "published", + "allow_guest", + "icon", + "column_break_sedp", + "badge", + "badge_color", + "is_group_page", + "documentation_section", + "content", + "section_break_twyn", + "linked_pages" + ], + "fields": [ + { + "fieldname": "title", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Title", + "reqd": 1 + }, + { + "fieldname": "route", + "fieldtype": "Data", + "in_list_view": 1, + "in_preview": 1, + "in_standard_filter": 1, + "label": "Route", + "reqd": 1, + "unique": 1 + }, + { + "default": "1", + "fieldname": "published", + "fieldtype": "Check", + "label": "Published" + }, + { + "default": "1", + "fieldname": "allow_guest", + "fieldtype": "Check", + "label": "Allow Guest" + }, + { + "depends_on": "eval:doc.is_group_page == 0", + "fieldname": "content", + "fieldtype": "Markdown Editor", + "ignore_xss_filter": 1, + "label": "Content" + }, + { + "description": "This is badge field, eg: GET , POST etc.", + "fieldname": "badge", + "fieldtype": "Data", + "label": "Badge" + }, + { + "description": "Add Tailwind colours like red, green, blue, yellow, purple, pink, indigo, cyan, teal, lime, orange, gray etc.", + "fieldname": "badge_color", + "fieldtype": "Data", + "label": "Badge Color" + }, + { + "fieldname": "column_break_sedp", + "fieldtype": "Column Break" + }, + { + "default": "0", + "description": "When enabled, this page can hold and display nested sub-pages, creating a structured hierarchy in the sidebar.", + "fieldname": "is_group_page", + "fieldtype": "Check", + "label": "Is Group Page" + }, + { + "fieldname": "documentation_section", + "fieldtype": "Section Break", + "label": "Documentation" + }, + { + "description": "\"Supports only icons from the lucid-react library. Enter the icon name in the format 'libraryPrefix/IconName' (e.g., 'Fa/FaFileExcel') to display it beside the title in the sidebar.\"\n", + "documentation_url": "https://lucide.dev/icons", + "fieldname": "icon", + "fieldtype": "Data", + "label": "Icon" + }, + { + "fieldname": "section_break_twyn", + "fieldtype": "Section Break" + }, + { + "depends_on": "eval:doc.is_group_page == 1", + "fieldname": "linked_pages", + "fieldtype": "Table", + "label": "Linked Pages", + "options": "Linked Commit Docs Page" + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2024-12-13 14:07:48.524842", + "modified_by": "Administrator", + "module": "commit", + "name": "Commit Docs Page", + "naming_rule": "Expression", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "creation", + "sort_order": "DESC", + "states": [], + "title_field": "title" } \ No newline at end of file diff --git a/commit/commit/doctype/commit_docs_page/commit_docs_page.py b/commit/commit/doctype/commit_docs_page/commit_docs_page.py index e3bf74f..3726f55 100644 --- a/commit/commit/doctype/commit_docs_page/commit_docs_page.py +++ b/commit/commit/doctype/commit_docs_page/commit_docs_page.py @@ -93,7 +93,7 @@ def publish_documentation(project_branch, endpoint, viewer_type, docs_name, pare 'commit_docs': commit_docs.name } -@frappe.whitelist() +@frappe.whitelist(allow_guest=True) def get_commit_docs_page(name): ''' Get the Commit Docs Page diff --git a/commit/commit/doctype/commit_docs_topbar_item/commit_docs_topbar_item.json b/commit/commit/doctype/commit_docs_topbar_item/commit_docs_topbar_item.json index d2034da..fa2edf2 100644 --- a/commit/commit/doctype/commit_docs_topbar_item/commit_docs_topbar_item.json +++ b/commit/commit/doctype/commit_docs_topbar_item/commit_docs_topbar_item.json @@ -53,6 +53,7 @@ "label": "Parent Label" }, { + "description": "\"Supports only icons from the lucid-react library. Enter the icon name, eg:\"Bell\" to display it beside the title in the sidebar.\"\n", "fieldname": "icon", "fieldtype": "Data", "label": "Icon" @@ -73,7 +74,7 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2024-11-09 18:41:50.962807", + "modified": "2024-12-13 14:08:16.402492", "modified_by": "Administrator", "module": "commit", "name": "Commit Docs Topbar Item", diff --git a/commit/www/commit.py b/commit/www/commit.py index d92d51f..4bbf913 100644 --- a/commit/www/commit.py +++ b/commit/www/commit.py @@ -2,19 +2,16 @@ import json import frappe.sessions import re - +from commit.api.meta_data import get_installed_apps no_cache = 1 SCRIPT_TAG_PATTERN = re.compile(r"\") CLOSING_SCRIPT_TAG_PATTERN = re.compile(r"") def get_context(context): - csrf_token = frappe.sessions.get_csrf_token() - frappe.db.commit() context = frappe._dict() context.boot = get_boot() - context.csrf_token = csrf_token context.build_version = frappe.utils.get_build_version() return context @@ -36,6 +33,7 @@ def get_boot(): show_system_apps = commit_settings.show_system_apps boot["show_system_apps"] = show_system_apps + boot["get_installed_apps"] = get_installed_apps() boot_json = frappe.as_json(boot, indent=None, separators=(",", ":")) boot_json = SCRIPT_TAG_PATTERN.sub("", boot_json) From 14a86e98df880bbac6305981ec63f46cb81b9da9 Mon Sep 17 00:00:00 2001 From: Sumit Jain Date: Fri, 20 Dec 2024 12:54:26 +0530 Subject: [PATCH 2/8] feat: replace react-icons with lucide-react icons for consistency and improved styling --- .../common/Checkbox/CreatableSelect.tsx | 15 ++- .../DynamicIconImport/IconComponent.tsx | 103 ++++++++---------- .../common/ImageUploader2/FileDrop.tsx | 13 +-- .../common/ImageUploader2/ImageUploader.tsx | 4 +- .../common/PageNotFound/PageNotFound.tsx | 10 +- .../features/APIClient/APIClientContent.tsx | 15 +-- .../features/api_viewer/APIDetails.tsx | 32 +++--- .../features/api_viewer/APIList.tsx | 16 +-- .../custommdxcomponent/CustomHeading.tsx | 6 +- .../features/documentation/OnThisPage.tsx | 4 +- .../features/projects/APIExplorer.tsx | 21 ++-- .../features/projects/AddMenuButton.tsx | 12 +- .../projects/Branch/ManageBranchItem.tsx | 14 +-- .../projects/Projects/ProjectCard.tsx | 12 +- .../features/projects/ViewERDButton.tsx | 10 +- dashboard/src/pages/features/docs/Footer.tsx | 18 ++- dashboard/src/pages/features/docs/Navbar.tsx | 8 +- dashboard/src/pages/features/docs/Sidebar.tsx | 10 +- dashboard/src/pages/features/erd/Graph.tsx | 7 +- .../src/pages/features/erd/TableHoverCard.tsx | 4 +- .../src/pages/features/erd/TableNode.tsx | 4 +- .../src/pages/features/erd/meta/MetaGraph.tsx | 7 +- 22 files changed, 158 insertions(+), 187 deletions(-) diff --git a/dashboard/src/components/common/Checkbox/CreatableSelect.tsx b/dashboard/src/components/common/Checkbox/CreatableSelect.tsx index 4c46907..6c1b7a7 100644 --- a/dashboard/src/components/common/Checkbox/CreatableSelect.tsx +++ b/dashboard/src/components/common/Checkbox/CreatableSelect.tsx @@ -13,10 +13,9 @@ import { PopoverTrigger, } from '@/components/ui/popover'; import { ScrollArea } from '@/components/ui/scroll-area'; -import { MdAdd, MdCheck } from 'react-icons/md'; -import { LuChevronsUpDown } from 'react-icons/lu'; import { Input } from '@/components/ui/input'; import { Controller, UseControllerProps, useFormContext } from 'react-hook-form'; +import { Check, ChevronsUpDown, Plus } from 'lucide-react'; export type ComboboxOptions = { value: string; @@ -76,7 +75,7 @@ export const CreatableSelect = ({ options, selected, className, label, mode = 's ) : ( `Select ${label ?? 'Item'}` )} - + @@ -111,7 +110,7 @@ export const CreatableSelect = ({ options, selected, className, label, mode = 's } }} > - + )} @@ -218,7 +217,7 @@ export const FormCreatableSelect = ({ ) : ( `Select ${label ?? 'Item'}` )} - + @@ -246,7 +245,7 @@ export const FormCreatableSelect = ({ } }} > - setIsCreating(true)} > {`Add ${label ?? 'Item'}`} - + )} diff --git a/dashboard/src/components/common/DynamicIconImport/IconComponent.tsx b/dashboard/src/components/common/DynamicIconImport/IconComponent.tsx index 7979661..f11595c 100644 --- a/dashboard/src/components/common/DynamicIconImport/IconComponent.tsx +++ b/dashboard/src/components/common/DynamicIconImport/IconComponent.tsx @@ -1,82 +1,65 @@ -import { CSSProperties, lazy, Suspense, SVGAttributes, useMemo } from "react"; -import { IconContext } from "react-icons"; +import React, { CSSProperties, lazy, Suspense, SVGAttributes, useMemo } from 'react'; -interface IProps { +interface LucideDynamicIconProps { icon: string; color?: string; - size?: string; + size?: number | string; className?: string; style?: CSSProperties; + strokeWidth?: number; + absoluteStrokeWidth?: boolean; attr?: SVGAttributes; fallback?: JSX.Element | null; } + // Helper to load the icon -const loadIcon = async (icon: string) => { - const [library, iconName] = icon.split("/"); - const lib = library.toLowerCase(); - // Statically construct the import statement using a function map - // Full list of importable libraries from react-icons - const moduleImporters: Record Promise> = { - ai: () => import("react-icons/ai"), // Ant Design Icons - bs: () => import("react-icons/bs"), // Bootstrap Icons - bi: () => import("react-icons/bi"), // BoxIcons - ci: () => import("react-icons/ci"), // Circum Icons - cg: () => import("react-icons/cg"), // css.gg - di: () => import("react-icons/di"), // Devicons - fi: () => import("react-icons/fi"), // Feather Icons - fc: () => import("react-icons/fc"), // Flat Color Icons - fa: () => import("react-icons/fa"), // Font Awesome 5 Icons - fa6: () => import("react-icons/fa6"), // Font Awesome 6 Icons - gi: () => import("react-icons/gi"), // Game Icons - go: () => import("react-icons/go"), // GitHub Octicons - gr: () => import("react-icons/gr"), // Grommet Icons - hi: () => import("react-icons/hi"), // Heroicons - hi2: () => import("react-icons/hi2"), // Heroicons v2 - im: () => import("react-icons/im"), // IcoMoon Free - lia: () => import("react-icons/lia"), // Icons8 Line Awesome - io: () => import("react-icons/io"), // Ionicons - io5: () => import("react-icons/io5"), // Ionicons v5 - lu: () => import("react-icons/lu"), // Lucide Icons - md: () => import("react-icons/md"), // Material Design Icons - pi: () => import("react-icons/pi"), // Phosphor Icons - rx: () => import("react-icons/rx"), // Radix Icons - ri: () => import("react-icons/ri"), // Remix Icons - si: () => import("react-icons/si"), // Simple Icons - sl: () => import("react-icons/sl"), // Simple Line Icons - tb: () => import("react-icons/tb"), // Tabler Icons - tfi: () => import("react-icons/tfi"), // Themify Icons - ti: () => import("react-icons/ti"), // Typicons - vsc: () => import("react-icons/vsc"), // VS Code Icons - wi: () => import("react-icons/wi"), // Weather Icons - }; +const loadLucideIcon = async (iconName: string) => { + try { + const module: any = await import('lucide-react'); + const IconComponent = module[iconName]; + + if (!IconComponent) { + throw new Error(`Icon "${iconName}" not found in Lucide React library`); + } - const importer = moduleImporters[lib]; - if (!importer) throw new Error(`Icon library "${library}" is not supported.`); - const module = await importer() - const IconComponent = module[iconName] - if (!IconComponent) throw new Error(`Icon "${icon}" not found in "${library}".`) - return IconComponent + return IconComponent; + } catch (error) { + console.error('Failed to load Lucide icon:', error); + throw error; + } }; -const DynamicIcon: React.FC = ({ icon, color, size, className, style, attr, fallback = null }) => { +const DynamicIcon: React.FC = ({ + icon, + color, + size = 24, + className, + style, + strokeWidth, + absoluteStrokeWidth, + attr, + fallback = null +}) => { // Memoize the icon component so it's loaded only when `icon` changes const Icon = useMemo( - () => lazy(() => loadIcon(icon).then((component) => ({ default: component }))), + () => lazy(() => loadLucideIcon(icon).then((component) => ({ default: component }))), [icon] ); - const iconContext = { - color, - size, - className, - style, - attr, - }; + return ( - - - + ); }; + export default DynamicIcon; diff --git a/dashboard/src/components/common/ImageUploader2/FileDrop.tsx b/dashboard/src/components/common/ImageUploader2/FileDrop.tsx index 4683ac7..018942a 100644 --- a/dashboard/src/components/common/ImageUploader2/FileDrop.tsx +++ b/dashboard/src/components/common/ImageUploader2/FileDrop.tsx @@ -1,12 +1,9 @@ import { Accept, useDropzone } from "react-dropzone" -import { MdOutlineDevices } from "react-icons/md" import { useEffect, useState } from "react" import { CustomFile } from "./ImageUploader" import { useToast } from "@/components/ui/use-toast" import { Button } from "@/components/ui/button" -import { TbTrash } from "react-icons/tb" -import { FiFile, FiLink } from 'react-icons/fi' -import { IoMdCheckmark } from "react-icons/io" +import { Check, MonitorSmartphone, Trash2, File as LucidFile, Link } from "lucide-react" export interface FileDropProps extends React.HTMLAttributes { @@ -87,7 +84,7 @@ export const FileDrop = ({ files, onFileChange, maxFiles = 1, uploading, accept,

Drag 'n' drop your files here.

@@ -128,7 +125,7 @@ export const FileListItem = ({ file, removeFile, isUploading, ...props }: FileLi {previewURL ? ( File preview ) : ( - file.fileType === 'file' ? : + file.fileType === 'file' ? : )}
@@ -140,10 +137,10 @@ export const FileListItem = ({ file, removeFile, isUploading, ...props }: FileLi
{isUploading ? ( - + ) : ( )}
diff --git a/dashboard/src/components/common/ImageUploader2/ImageUploader.tsx b/dashboard/src/components/common/ImageUploader2/ImageUploader.tsx index e49d7d3..0fbed14 100644 --- a/dashboard/src/components/common/ImageUploader2/ImageUploader.tsx +++ b/dashboard/src/components/common/ImageUploader2/ImageUploader.tsx @@ -1,6 +1,5 @@ import { useFrappeUpdateDoc } from "frappe-react-sdk" import { Accept } from "react-dropzone" -import { MdOutlineFileUpload } from 'react-icons/md' import { useState } from "react" import { useToast } from "@/components/ui/use-toast" import { File } from "@/types/Core/File" @@ -11,6 +10,7 @@ import { SpinnerLoader } from "../FullPageLoader/SpinnerLoader" import { DocumentUploadModal } from "./DocumentUploadModal" import { cn } from "@/lib/utils" import { useGetFilePreviewUrl } from "./FileDrop" +import { Upload } from "lucide-react" /** * Custom File Type for FILE UPLOADER component; with 'fileID' for unique ID & 'preview' for blob URL. @@ -136,7 +136,7 @@ export const ImageUploader = ({ file, doctype, docname, onUpdate, fieldname = 'i : updatingDoc ?
:
- {icon ? icon : } + {icon ? icon : }
} {deleteImage && } diff --git a/dashboard/src/components/common/PageNotFound/PageNotFound.tsx b/dashboard/src/components/common/PageNotFound/PageNotFound.tsx index d126f03..2e097d5 100644 --- a/dashboard/src/components/common/PageNotFound/PageNotFound.tsx +++ b/dashboard/src/components/common/PageNotFound/PageNotFound.tsx @@ -1,9 +1,9 @@ import { motion } from 'framer-motion'; import { Button } from "@/components/ui/button"; -import { IoCloudOutline } from "react-icons/io5"; import { useNavigate } from 'react-router-dom'; +import { Cloud } from 'lucide-react'; -export const PageNotFound = () => { +const PageNotFound = () => { const navigate = useNavigate() @@ -33,7 +33,7 @@ export const PageNotFound = () => { transition={{ duration: 1.2, ease: 'easeInOut' }} className="mb-10" > - + { ); -} \ No newline at end of file +} + +export default PageNotFound; \ No newline at end of file diff --git a/dashboard/src/components/features/APIClient/APIClientContent.tsx b/dashboard/src/components/features/APIClient/APIClientContent.tsx index 08c95cd..8472e78 100644 --- a/dashboard/src/components/features/APIClient/APIClientContent.tsx +++ b/dashboard/src/components/features/APIClient/APIClientContent.tsx @@ -6,10 +6,9 @@ import { Input } from "@/components/ui/input" import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table" import { Argument } from "@/types/APIData" import { FrappeConfig, FrappeContext } from "frappe-react-sdk" +import { ChevronDown, Plus } from "lucide-react" import { useCallback, useContext, useEffect, useState } from "react" import { FormProvider, useForm } from "react-hook-form" -import { FaCaretDown } from "react-icons/fa" -import { IoAdd } from "react-icons/io5"; export interface APIClientContentProps { @@ -18,7 +17,7 @@ export interface APIClientContentProps { open: boolean } -export const APIClientContent = ({ endpoint, open, parameters }: APIClientContentProps) => { +const APIClientContent = ({ endpoint, open, parameters }: APIClientContentProps) => { const [requestType, setRequestType] = useState<"GET" | "POST">('GET') @@ -164,7 +163,7 @@ export const APIClientContent = ({ endpoint, open, parameters }: APIClientConten className="rounded-r-none w-[12ch]" > {requestType} - + @@ -196,7 +195,7 @@ export const APIClientContent = ({ endpoint, open, parameters }: APIClientConten className="w-[14ch]" > {paramsType === 'params' ? 'Params' : 'Form Data'} - + @@ -256,7 +255,7 @@ export const APIClientContent = ({ endpoint, open, parameters }: APIClientConten + }} variant="outline">Add Param } @@ -281,4 +280,6 @@ export const APIClientContent = ({ endpoint, open, parameters }: APIClientConten ) -} \ No newline at end of file +} + +export default APIClientContent \ No newline at end of file diff --git a/dashboard/src/components/features/api_viewer/APIDetails.tsx b/dashboard/src/components/features/api_viewer/APIDetails.tsx index 3245c83..49825b1 100644 --- a/dashboard/src/components/features/api_viewer/APIDetails.tsx +++ b/dashboard/src/components/features/api_viewer/APIDetails.tsx @@ -6,17 +6,17 @@ import { Button } from "@/components/ui/button" import { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table" import { web_url } from "@/config/socket" import { APIData, Argument } from "@/types/APIData" -import { XMarkIcon } from "@heroicons/react/24/outline" import { useFrappeGetCall } from "frappe-react-sdk" -import { useMemo, useState } from "react" -import { MdOutlineFileDownload } from "react-icons/md" -import { APIDocumentationOfSiteApp } from "../documentation/APIDocumentation" +import { lazy, Suspense, useMemo, useState } from "react" import { Dialog } from "@/components/ui/dialog" -import { APIClientContent } from "../APIClient/APIClientContent" import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip" -import { AiOutlineThunderbolt } from "react-icons/ai" +import { Download, X, Zap } from "lucide-react" -export const APIDetails = ({ project_branch, endpointData, selectedEndpoint, setSelectedEndpoint, viewerType, mutate }: { project_branch: string, endpointData: APIData[], selectedEndpoint: string, setSelectedEndpoint: React.Dispatch>, viewerType: string, mutate: () => void }) => { + +const APIDocumentationOfSiteApp = lazy(() => import('../documentation/APIDocumentation')) +const APIClientContent = lazy(() => import('../APIClient/APIClientContent')) + +const APIDetails = ({ project_branch, endpointData, selectedEndpoint, setSelectedEndpoint, viewerType, mutate }: { project_branch: string, endpointData: APIData[], selectedEndpoint: string, setSelectedEndpoint: React.Dispatch>, viewerType: string, mutate: () => void }) => { const data = useMemo(() => { return endpointData.find((endpoint: APIData) => endpoint.name === selectedEndpoint) }, [endpointData, selectedEndpoint]) @@ -73,7 +73,7 @@ export const APIDetails = ({ project_branch, endpointData, selectedEndpoint, set > Close panel -