Skip to content

Commit b4cd2a4

Browse files
committed
feat: add node resource overview
1 parent ce2bbc2 commit b4cd2a4

File tree

4 files changed

+1033
-346
lines changed

4 files changed

+1033
-346
lines changed

package-lock.json

Lines changed: 92 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"@radix-ui/react-radio-group": "^1.3.7",
2222
"@radix-ui/react-separator": "^1.1.7",
2323
"@radix-ui/react-slot": "^1.2.3",
24+
"@radix-ui/react-tabs": "^1.1.13",
2425
"@radix-ui/react-tooltip": "^1.2.7",
2526
"@tailwindcss/vite": "^4.1.8",
2627
"@tanstack/react-table": "^8.21.3",
@@ -62,4 +63,4 @@
6263
"typescript-eslint": "^8.30.1",
6364
"vite": "^6.3.5"
6465
}
65-
}
66+
}

src/components/ui/tabs.tsx

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import * as React from "react";
2+
import * as TabsPrimitive from "@radix-ui/react-tabs";
3+
4+
import { cn } from "@/lib/utils";
5+
6+
function Tabs({
7+
className,
8+
...props
9+
}: React.ComponentProps<typeof TabsPrimitive.Root>) {
10+
return (
11+
<TabsPrimitive.Root
12+
data-slot="tabs"
13+
className={cn("flex flex-col gap-2", className)}
14+
{...props}
15+
/>
16+
);
17+
}
18+
19+
function TabsList({
20+
className,
21+
...props
22+
}: React.ComponentProps<typeof TabsPrimitive.List>) {
23+
return (
24+
<TabsPrimitive.List
25+
data-slot="tabs-list"
26+
className={cn(
27+
"bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",
28+
className,
29+
)}
30+
{...props}
31+
/>
32+
);
33+
}
34+
35+
function TabsTrigger({
36+
className,
37+
...props
38+
}: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
39+
return (
40+
<TabsPrimitive.Trigger
41+
data-slot="tabs-trigger"
42+
className={cn(
43+
"data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
44+
className,
45+
)}
46+
{...props}
47+
/>
48+
);
49+
}
50+
51+
function TabsContent({
52+
className,
53+
...props
54+
}: React.ComponentProps<typeof TabsPrimitive.Content>) {
55+
return (
56+
<TabsPrimitive.Content
57+
data-slot="tabs-content"
58+
className={cn("flex-1 outline-none", className)}
59+
{...props}
60+
/>
61+
);
62+
}
63+
64+
export { Tabs, TabsList, TabsTrigger, TabsContent };

0 commit comments

Comments
 (0)