MigrationsEmptyState.tsx 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import { useParams } from 'common'
  2. import { Terminal } from 'lucide-react'
  3. import { Card, CardContent, CardHeader, CardTitle } from 'ui'
  4. import { EmptyStatePresentational } from 'ui-patterns'
  5. import CommandRender from '@/components/interfaces/Functions/CommandRender'
  6. export const MigrationsEmptyState = () => {
  7. const { ref } = useParams()
  8. const commands = [
  9. {
  10. comment: 'Link your project',
  11. command: `briven link --project-ref ${ref}`,
  12. jsx: () => {
  13. return (
  14. <>
  15. <span className="text-brand-600">briven</span> link --project-ref {ref}
  16. </>
  17. )
  18. },
  19. },
  20. {
  21. comment: 'Create a new migration called "new-migration"',
  22. command: `briven migration new new-migration`,
  23. jsx: () => {
  24. return (
  25. <>
  26. <span className="text-brand-600">briven</span> migration new new-migration
  27. </>
  28. )
  29. },
  30. },
  31. {
  32. comment: 'Run all migrations for this project',
  33. command: `briven db push`,
  34. jsx: () => {
  35. return (
  36. <>
  37. <span className="text-brand-600">briven</span> db push
  38. </>
  39. )
  40. },
  41. },
  42. ]
  43. return (
  44. <EmptyStatePresentational
  45. icon={Terminal}
  46. title="Run your first migration"
  47. description="Create and run your first migration using the Briven CLI."
  48. className="gap-y-6"
  49. >
  50. <Card>
  51. <CardHeader>
  52. <CardTitle>Terminal instructions</CardTitle>
  53. </CardHeader>
  54. <CardContent>
  55. <CommandRender commands={commands} />
  56. </CardContent>
  57. </Card>
  58. </EmptyStatePresentational>
  59. )
  60. }