Skip to content

Commit f47eda6

Browse files
add api snippets to explorer section (#7971)
Co-authored-by: 0xFirekeeper <[email protected]>
1 parent 2328985 commit f47eda6

File tree

3 files changed

+315
-38
lines changed

3 files changed

+315
-38
lines changed

apps/dashboard/src/@/components/blocks/code/code-segment.client.tsx

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
"use client";
2+
23
import type React from "react";
34
import { type Dispatch, type SetStateAction, useMemo } from "react";
45
import { CodeClient } from "@/components/ui/code/code.client";
56
import { TabButtons } from "@/components/ui/tabs";
67
import { cn } from "@/lib/utils";
78

89
export type CodeEnvironment =
10+
| "api"
911
| "javascript"
1012
| "typescript"
1113
| "react"
1214
| "react-native"
13-
| "unity";
15+
| "dotnet"
16+
| "unity"
17+
| "curl";
1418

1519
type SupportedEnvironment = {
1620
environment: CodeEnvironment;
@@ -20,6 +24,10 @@ type SupportedEnvironment = {
2024
type CodeSnippet = Partial<Record<CodeEnvironment, string>>;
2125

2226
const Environments: SupportedEnvironment[] = [
27+
{
28+
environment: "api",
29+
title: "API",
30+
},
2331
{
2432
environment: "javascript",
2533
title: "JavaScript",
@@ -36,10 +44,18 @@ const Environments: SupportedEnvironment[] = [
3644
environment: "react-native",
3745
title: "React Native",
3846
},
47+
{
48+
environment: "dotnet",
49+
title: ".NET",
50+
},
3951
{
4052
environment: "unity",
4153
title: "Unity",
4254
},
55+
{
56+
environment: "curl",
57+
title: "cURL",
58+
},
4359
];
4460

4561
interface CodeSegmentProps {
@@ -122,9 +138,14 @@ export const CodeSegment: React.FC<CodeSegmentProps> = ({
122138
: activeEnvironment === "react" ||
123139
activeEnvironment === "react-native"
124140
? "tsx"
125-
: activeEnvironment === "unity"
141+
: activeEnvironment === "unity" ||
142+
activeEnvironment === "dotnet"
126143
? "cpp"
127-
: activeEnvironment
144+
: activeEnvironment === "api"
145+
? "javascript"
146+
: activeEnvironment === "curl"
147+
? "bash"
148+
: activeEnvironment
128149
}
129150
/>
130151
)}

0 commit comments

Comments
 (0)