diff --git a/app/components/QuickStartTabs.tsx b/app/components/QuickStartTabs.tsx new file mode 100644 index 0000000..26af5cb --- /dev/null +++ b/app/components/QuickStartTabs.tsx @@ -0,0 +1,206 @@ +"use client"; + +import Link from "next/link"; +import { useRef, useState } from "react"; +import CommandSnippet from "./CommandSnippet"; + +export type QuickStartStep = { + step: string; + description: string; +}; + +type QuickStartTabsProps = { + dockerCommand: string; + dockerSteps: QuickStartStep[]; + vscodeSteps: QuickStartStep[]; + /** Deep link that opens the extension's DocumentDB Local setup wizard. */ + vscodeDeepLinkUrl: string; + /** Marketplace page, for visitors who do not have the extension yet. */ + vscodeMarketplaceUrl: string; + /** Full guide for each path, linked from the footer of the matching panel. */ + dockerDocsUrl: string; + vscodeDocsUrl: string; +}; + +// "Terminal" rather than "Docker": both paths run the same Docker container, and labelling one +// of them "Docker" implies the other avoids it. +const TABS = [ + { id: "terminal", label: "Terminal" }, + { id: "vscode", label: "VS Code" }, +] as const; + +type TabId = (typeof TABS)[number]["id"]; + +function StepList({ steps }: { steps: QuickStartStep[] }) { + return ( +
{item.description}
++ Prefer to set it up from your editor? Use the{" "} + {" "} + tab. +
++ Needs Docker Desktop or Docker Engine on the same machine as VS Code. + The extension pulls the image, starts it, and saves the connection for + you. It never installs Docker or changes your system. +
++ If nothing happens, check that the extension is installed and up to + date, then run{" "} + + DocumentDB: Set up DocumentDB Local + {" "} + from the Command Palette. +
+Open source document database @@ -372,43 +397,22 @@ export default function Home() { Quick start
- Start DocumentDB Local with Docker, then connect on port - 10260. + Run it from your terminal, or let the VS Code extension set it + up for you. Both start the same DocumentDB Local container.
- {item.description} -
-