diff --git a/app/components/Tabs.tsx b/app/components/Tabs.tsx new file mode 100644 index 0000000..d1ac9c8 --- /dev/null +++ b/app/components/Tabs.tsx @@ -0,0 +1,64 @@ +"use client"; + +import { useState, ReactNode, Children, isValidElement } from "react"; + +interface TabsProps { + children: ReactNode; +} + +interface TabPanelProps { + children: ReactNode; + title: string; +} + +export function TabPanel({ children, title }: TabPanelProps) { + return
{children}
; +} + +export function Tabs({ children }: TabsProps) { + const [activeTab, setActiveTab] = useState(0); + + const handleTabClick = (index: number) => { + setActiveTab(index); + }; + + const arrayChildren = Children.toArray(children).filter(child => isValidElement(child)); + + return ( +
+
+ +
+
+ {arrayChildren.map((child, index) => { + if (index === activeTab) { + if (isValidElement(child)) { + return
{child}
; + } + } + return null; + })} +
+
+ ); +} diff --git a/app/docs/page.tsx b/app/docs/page.tsx index 918dafb..3fb6fbd 100644 --- a/app/docs/page.tsx +++ b/app/docs/page.tsx @@ -1,5 +1,6 @@ "use client"; import { useState } from "react"; +import { TabPanel, Tabs } from "../components/Tabs"; export default function Docs() { const [currentPage, setCurrentPage] = useState("main"); @@ -554,14 +555,27 @@ export default function Docs() {

1. Creating a new DocumentDB instance

-
-
-                            {`docker pull ghcr.io/microsoft/documentdb/documentdb-local:latest
+                        
+                          
+                            
+
+                              {`docker pull ghcr.io/microsoft/documentdb/documentdb-local:latest
 docker tag ghcr.io/microsoft/documentdb/documentdb-local:latest documentdb
 docker run -dt -p 10260:10260 --name documentdb-container documentdb --username  --password 
 docker image rm -f ghcr.io/microsoft/documentdb/documentdb-local:latest || echo "No existing documentdb image to remove"`}
-                          
-
+
+ + +
+
+                              {`docker pull ghcr.io/microsoft/documentdb/documentdb-local:latest
+docker tag ghcr.io/microsoft/documentdb/documentdb-local:latest documentdb
+docker run -dt -p 10260:10260 --name documentdb-container documentdb --username  --password 
+docker image rm -f ghcr.io/microsoft/documentdb/documentdb-local:latest; if ($LASTEXITCODE -ne 0) { echo "No existing documentdb image to remove" }`}
+                              
+
+
+

Note: Replace{" "}