FormHeader.tsx 866 B

1234567891011121314151617181920212223242526272829303132333435
  1. import { ReactNode } from 'react'
  2. import { cn } from 'ui'
  3. import { DocsButton } from '../DocsButton'
  4. export const FormHeader = ({
  5. title,
  6. description,
  7. docsUrl,
  8. actions,
  9. className,
  10. }: {
  11. title: string
  12. description?: string
  13. docsUrl?: string
  14. actions?: ReactNode
  15. className?: string
  16. }) => {
  17. return (
  18. <div
  19. className={cn(
  20. `w-full mb-6 flex flex-col sm:flex-row md:items-center justify-between gap-4 md:h-(--header-height) ${className}`
  21. )}
  22. >
  23. <div className="space-y-1">
  24. <h3 className="text-foreground text-xl prose">{title}</h3>
  25. {description && <p className="prose text-sm max-w-2xl">{description}</p>}
  26. </div>
  27. <div className="flex flex-col sm:flex-row md:items-center gap-x-2">
  28. {docsUrl !== undefined && <DocsButton href={docsUrl} />}
  29. {actions}
  30. </div>
  31. </div>
  32. )
  33. }