HighAvailabilityBadge.tsx 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import { ArrowRight } from 'lucide-react'
  2. import Link from 'next/link'
  3. import { cn, HoverCard, HoverCardContent, HoverCardTrigger, Separator } from 'ui'
  4. import { ServerLightGrid } from './ServerLightGrid'
  5. import { DOCS_URL } from '@/lib/constants'
  6. interface HighAvailabilityBadgeProps {
  7. size?: 'default' | 'small'
  8. }
  9. export function HighAvailabilityBadge({ size = 'default' }: HighAvailabilityBadgeProps) {
  10. return (
  11. <HoverCard openDelay={200} closeDelay={100}>
  12. <HoverCardTrigger asChild>
  13. <div
  14. className={cn(
  15. 'relative inline-flex items-center justify-center overflow-hidden rounded-md text-center font-mono uppercase',
  16. 'cursor-default whitespace-nowrap font-medium tracking-[0.06em] text-[11px] leading-[1.1] px-[5.5px] py-[3px]',
  17. 'transition-all',
  18. 'border border-purple-700 dark:border-purple-600/50',
  19. 'bg-purple-400 text-purple-1100 dark:bg-purple-100'
  20. )}
  21. >
  22. {size === 'small' ? 'HA' : 'High Availability'}
  23. <span className="animate-badge-shimmer pointer-events-none absolute inset-0 bg-gradient-to-br from-transparent via-white/35 to-transparent blur-md" />
  24. </div>
  25. </HoverCardTrigger>
  26. <HoverCardContent side="bottom" align="start" className="w-72 overflow-hidden p-0">
  27. <div className="h-24 bg-surface-75">
  28. <ServerLightGrid />
  29. </div>
  30. <Separator />
  31. <div className="flex flex-col gap-1 p-3 px-5">
  32. <p className="text-sm text-foreground-light">
  33. Driven by <span className="text-foreground">Multigres</span>, a horizontally scalable
  34. Postgres architecture that supports highly-available and globally distributed
  35. deployments.
  36. </p>
  37. <Link
  38. href={`${DOCS_URL}/guides/deployment/high-availability`}
  39. target="_blank"
  40. rel="noopener noreferrer"
  41. className="mt-1 inline-flex items-center gap-1 text-xs text-foreground-lighter transition-colors hover:text-foreground"
  42. >
  43. Read more
  44. <ArrowRight size={12} strokeWidth={1.5} />
  45. </Link>
  46. </div>
  47. </HoverCardContent>
  48. </HoverCard>
  49. )
  50. }