From 9b2177fea363c38cd0472a88d7c154d976d2f35a Mon Sep 17 00:00:00 2001 From: ngc2207 Date: Fri, 13 Dec 2024 16:02:25 +0800 Subject: [PATCH] feat(playground): add PlaygroundPage component with tabbed interface and update sidebar navigation --- package.json | 1 + src/app/dashboard/playground/page.tsx | 56 +++++++++++++++++++++++++++ src/components/app-sidebar.tsx | 2 +- src/components/ui/tabs.tsx | 55 ++++++++++++++++++++++++++ 4 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 src/app/dashboard/playground/page.tsx create mode 100644 src/components/ui/tabs.tsx diff --git a/package.json b/package.json index e4bb817..017ea2a 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "@radix-ui/react-select": "^2.1.2", "@radix-ui/react-separator": "^1.1.0", "@radix-ui/react-slot": "^1.1.0", + "@radix-ui/react-tabs": "^1.1.2", "@radix-ui/react-tooltip": "^1.1.4", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", diff --git a/src/app/dashboard/playground/page.tsx b/src/app/dashboard/playground/page.tsx new file mode 100644 index 0000000..093cbad --- /dev/null +++ b/src/app/dashboard/playground/page.tsx @@ -0,0 +1,56 @@ +import { Bot, Columns2, FileCode } from "lucide-react"; +import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; + +export default function PlaygroundPage() { + return ( +
+ +
+
+
+
+ + + Split + + + + Editor + + + + Diff + + + +
+
+
+ +
+
+
+
+
+
+ + +
+
+
+ + +
+
+
+
+
+
+ +
+
+
+ +
+ ); +} diff --git a/src/components/app-sidebar.tsx b/src/components/app-sidebar.tsx index aab162d..7aa9c3a 100644 --- a/src/components/app-sidebar.tsx +++ b/src/components/app-sidebar.tsx @@ -41,7 +41,7 @@ export function AppSidebar({ ...props }: React.ComponentProps) { navMain: [ { title: "Playground", - url: "#", + url: "/dashboard/playground", icon: SquareTerminal, isActive: true, items: [ diff --git a/src/components/ui/tabs.tsx b/src/components/ui/tabs.tsx new file mode 100644 index 0000000..0f4caeb --- /dev/null +++ b/src/components/ui/tabs.tsx @@ -0,0 +1,55 @@ +"use client" + +import * as React from "react" +import * as TabsPrimitive from "@radix-ui/react-tabs" + +import { cn } from "@/lib/utils" + +const Tabs = TabsPrimitive.Root + +const TabsList = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +TabsList.displayName = TabsPrimitive.List.displayName + +const TabsTrigger = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +TabsTrigger.displayName = TabsPrimitive.Trigger.displayName + +const TabsContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +TabsContent.displayName = TabsPrimitive.Content.displayName + +export { Tabs, TabsList, TabsTrigger, TabsContent }