@@ -12,9 +12,9 @@ import type { FullEnvironment } from "@/types/environment";
1212type Framework = "nextjs" | "react" | "js" ;
1313
1414const frameworkNames : Record < Framework , string > = {
15- js : "JavaScript" ,
16- react : "React" ,
1715 nextjs : "Next.js" ,
16+ react : "React" ,
17+ js : "Node.js / JS" ,
1818} ;
1919
2020export function SetupGuide ( { environment } : { environment : FullEnvironment } ) {
@@ -32,14 +32,6 @@ export function SetupGuide({ environment }: { environment: FullEnvironment }) {
3232 return selectedFramework === "nextjs" ? `"use client";\n\n${ code } ` : code ;
3333 } ;
3434
35- const getProviderTitle = ( ) => {
36- if ( selectedFramework === "nextjs" ) {
37- return "2. Configure the Provider (app/providers.tsx)" ;
38- }
39-
40- return "2. Configure the Provider (main.tsx)" ;
41- } ;
42-
4335 const CodeBlock = ( {
4436 code,
4537 section,
@@ -66,8 +58,8 @@ export function SetupGuide({ environment }: { environment: FullEnvironment }) {
6658 className = { cn (
6759 "h-7 rounded px-2 text-xs transition-all" ,
6860 isCopied
69- ? "bg-emerald-50 text-emerald-600"
70- : "bg-gray-100 text-gray-600"
61+ ? "bg-emerald-50 text-emerald-600 hover:bg-emerald-100 "
62+ : "bg-gray-100 text-gray-600 hover:bg-gray-200 "
7163 ) }
7264 onClick = { ( ) => handleCopy ( code , section ) }
7365 variant = "ghost"
@@ -116,7 +108,7 @@ export function SetupGuide({ environment }: { environment: FullEnvironment }) {
116108 </ div >
117109
118110 < div className = "flex items-center space-x-6 border-gray-100 border-b" >
119- { ( Object . keys ( frameworkNames ) as Framework [ ] ) . map ( ( fw ) => {
111+ { ( [ "nextjs" , "react" , "js" ] as Framework [ ] ) . map ( ( fw ) => {
120112 const isActive = selectedFramework === fw ;
121113 return (
122114 < Button
@@ -150,14 +142,18 @@ export function SetupGuide({ environment }: { environment: FullEnvironment }) {
150142 < CodeBlock
151143 code = { SNIPPETS . vanilla ( environment . apiKey ) }
152144 section = "vanilla"
153- title = "2. Initialize & Use"
145+ title = "2. Initialize & Use (Browser or Node.js) "
154146 />
155147 ) : (
156148 < >
157149 < CodeBlock
158150 code = { withDirective ( SNIPPETS . provider ( environment . apiKey ) ) }
159151 section = "provider"
160- title = { getProviderTitle ( ) }
152+ title = {
153+ selectedFramework === "nextjs"
154+ ? "2. Configure the Provider (app/providers.tsx)"
155+ : "2. Configure the Provider (main.tsx)"
156+ }
161157 />
162158 < CodeBlock
163159 code = { withDirective ( SNIPPETS . usage ) }
0 commit comments