AlphaNotice.tsx 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import { ExternalLink } from 'lucide-react'
  2. import Link from 'next/link'
  3. import { PropsWithChildren } from 'react'
  4. import { Badge, Button } from 'ui'
  5. import { Admonition } from 'ui-patterns'
  6. import { BASE_PATH } from '@/lib/constants'
  7. interface AlphaNoticeProps {
  8. entity: string
  9. feedbackUrl: string
  10. className?: string
  11. }
  12. export const AlphaNotice = ({
  13. entity,
  14. feedbackUrl,
  15. className,
  16. children,
  17. }: PropsWithChildren<AlphaNoticeProps>) => {
  18. return (
  19. <Admonition
  20. showIcon={false}
  21. type="tip"
  22. layout="horizontal"
  23. actions={
  24. <Button asChild type="default" icon={<ExternalLink strokeWidth={1.5} />} className="mt-2">
  25. <Link target="_blank" rel="noopener noreferrer" href={feedbackUrl}>
  26. Share feedback
  27. </Link>
  28. </Button>
  29. }
  30. className={className}
  31. >
  32. {/* Background image */}
  33. <div className="absolute -inset-16 z-0 opacity-50">
  34. <img
  35. src={`${BASE_PATH}/img/reports/bg-grafana-dark.svg`}
  36. alt="Briven Grafana"
  37. className="w-full h-full object-cover object-right hidden dark:block"
  38. />
  39. <img
  40. src={`${BASE_PATH}/img/reports/bg-grafana-light.svg`}
  41. alt="Briven Grafana"
  42. className="w-full h-full object-cover object-right dark:hidden"
  43. />
  44. <div className="absolute inset-0 bg-linear-to-r from-background-alternative to-transparent" />
  45. </div>
  46. {/* Content */}
  47. <div className="relative z-10 flex flex-col md:flex-row md:items-center gap-y-2 md:gap-x-8 justify-between px-2">
  48. <div className="flex flex-col gap-y-0.5">
  49. <div className="flex flex-col gap-y-2 items-start">
  50. <Badge variant="success" className="-ml-0.5">
  51. New
  52. </Badge>
  53. <p className="text-sm font-medium">Introducing {entity.toLocaleLowerCase()}</p>
  54. </div>
  55. <p className="text-sm text-foreground-lighter text-balance">
  56. {entity} {entity.endsWith('s') ? 'are' : 'is'} now in private alpha. Expect rapid
  57. changes, limited features, and possible breaking updates. Please share feedback as we
  58. refine the experience and expand access.
  59. </p>
  60. {children}
  61. </div>
  62. </div>
  63. </Admonition>
  64. )
  65. }