content.tsx 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import { CodeBlock } from 'ui-patterns/CodeBlock'
  2. import type { StepContentProps } from '@/components/interfaces/ConnectSheet/Connect.types'
  3. import examples from '@/components/interfaces/ConnectSheet/DirectConnectionExamples'
  4. /**
  5. * Step component for direct connection install commands.
  6. */
  7. function DirectInstallContent({ state }: StepContentProps) {
  8. const connectionType = (state.connectionType as string) ?? 'uri'
  9. const example = examples[connectionType as keyof typeof examples]
  10. const exampleInstallCommands = example?.installCommands ?? []
  11. if (exampleInstallCommands.length === 0) {
  12. return null
  13. }
  14. return (
  15. <div className="flex flex-col gap-2">
  16. {exampleInstallCommands.map((cmd) => (
  17. <CodeBlock
  18. key={`example-install-command-${cmd}`}
  19. className="[&_code]:text-foreground"
  20. wrapperClassName="lg:col-span-2"
  21. value={cmd}
  22. hideLineNumbers
  23. language="bash"
  24. >
  25. {cmd}
  26. </CodeBlock>
  27. ))}
  28. </div>
  29. )
  30. }
  31. export default DirectInstallContent