'use client'; import { useState } from 'react'; import styles from './Clients.module.css'; export default function Clients({ version, }: { version: string; }) { const csharpSvg = ` `; const versionClients = { 1: [ { name: 'C#', repoLink: 'https://github.com/onspring-technologies/onspring-api-sdk/tree/v1.1', installCommand: 'dotnet add package Onspring.API.SDK --version 2.1.0', svg: csharpSvg, official: true, }, ], 2: [ { name: 'C#', repoLink: 'https://github.com/onspring-technologies/onspring-api-sdk', installCommand: 'dotnet add package Onspring.API.SDK', svg: csharpSvg, official: true, }, { name: 'Javascript', repoLink: 'https://github.com/StevanFreeborn/onspring-api-sdk-javascript', installCommand: 'npm install onspring-api-sdk', svg: ` `, official: false, }, { name: 'Python', repoLink: 'https://github.com/StevanFreeborn/onspring-api-sdk-python', installCommand: 'pip install OnspringApiSdk', svg: ` `, official: false, }, ], } as { [key: string]: { name: string; repoLink: string; installCommand: string; svg: string; official: boolean; }[]; }; const clients = versionClients[version]; const [selectedClient, setSelectedClient] = useState( clients[0] ); const [copied, setCopied] = useState(false); const handleCopyButtonClick = () => { navigator.clipboard.writeText( selectedClient.installCommand ); setCopied(true); setTimeout(() => { setCopied(false); }, 500); }; return (
); }