CreateAppSheetStep.tsx 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { PropsWithChildren } from 'react'
  2. interface StepProps {
  3. number: number
  4. title: string
  5. description: string
  6. isLast?: boolean
  7. disabled?: boolean
  8. }
  9. export function CreateAppSheetStep({
  10. number,
  11. title,
  12. description,
  13. isLast = false,
  14. disabled = false,
  15. children,
  16. }: PropsWithChildren<StepProps>) {
  17. return (
  18. <div
  19. className={`flex items-start gap-6 self-stretch transition-opacity ${disabled ? 'opacity-40 pointer-events-none' : ''}`}
  20. >
  21. <div className="relative self-stretch shrink-0 w-6">
  22. <div className="absolute inset-0 flex items-start justify-center">
  23. {!isLast && (
  24. <div
  25. aria-hidden
  26. className="absolute left-[calc(50%-1px)] w-px bg-border opacity-60 h-full"
  27. />
  28. )}
  29. <div className="relative z-10 flex font-mono text-xs items-center justify-center min-w-6 w-6 h-6 border border-default rounded-md bg-surface-100 text-foreground-light">
  30. {number}
  31. </div>
  32. </div>
  33. </div>
  34. <div className={`w-full ${isLast ? '' : 'pb-10'}`}>
  35. <p className="text-sm font-medium text-foreground mb-1">{title}</p>
  36. <p className="text-sm text-foreground-light mb-4">{description}</p>
  37. {children}
  38. </div>
  39. </div>
  40. )
  41. }