content.tsx36 lines · main
| 1 | import { CodeBlock } from 'ui-patterns/CodeBlock' |
| 2 | |
| 3 | import type { StepContentProps } from '@/components/interfaces/ConnectSheet/Connect.types' |
| 4 | |
| 5 | const ORM_INSTALL_COMMANDS: Record<string, string[]> = { |
| 6 | prisma: ['npm install prisma --save-dev', 'npx prisma init'], |
| 7 | drizzle: ['npm install drizzle-orm', 'npm install drizzle-kit --save-dev'], |
| 8 | } |
| 9 | |
| 10 | function OrmInstallContent({ state }: StepContentProps) { |
| 11 | const ormKey = String(state.orm ?? '') |
| 12 | const commands = ORM_INSTALL_COMMANDS[ormKey] |
| 13 | |
| 14 | if (!commands?.length) { |
| 15 | return null |
| 16 | } |
| 17 | |
| 18 | return ( |
| 19 | <div className="flex flex-col gap-2"> |
| 20 | {commands.map((cmd, index) => ( |
| 21 | <CodeBlock |
| 22 | key={index} |
| 23 | className="[&_code]:text-foreground" |
| 24 | wrapperClassName="lg:col-span-2" |
| 25 | value={cmd} |
| 26 | hideLineNumbers |
| 27 | language="bash" |
| 28 | > |
| 29 | {cmd} |
| 30 | </CodeBlock> |
| 31 | ))} |
| 32 | </div> |
| 33 | ) |
| 34 | } |
| 35 | |
| 36 | export default OrmInstallContent |