AdvisorRulesPreview.tsx 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import { useParams } from 'common'
  2. import Image from 'next/image'
  3. import { useIsAdvisorRulesEnabled } from './FeaturePreviewContext'
  4. import { InlineLink } from '@/components/ui/InlineLink'
  5. import { BASE_PATH } from '@/lib/constants'
  6. export const AdvisorRulesPreview = () => {
  7. const { ref } = useParams()
  8. const isAdvisorRulesEnabled = useIsAdvisorRulesEnabled()
  9. return (
  10. <div>
  11. <p className="text-sm text-foreground-light mb-4">
  12. Disable specific Advisor categories or rules to prevent them from showing up in Advisor
  13. reports or email notifications. This could be useful for rules that might not be applicable
  14. to your project.
  15. </p>
  16. <Image
  17. src={`${BASE_PATH}/img/previews/advisor-rule-preview.png`}
  18. width={1296}
  19. height={900}
  20. alt="api-docs-side-panel-preview"
  21. className="rounded-sm border mb-4"
  22. />
  23. <div className="space-y-2 mt-4!">
  24. <p className="text-sm">Enabling this preview will:</p>
  25. <ul className="list-disc pl-6 text-sm text-foreground-light space-y-1">
  26. <li>
  27. Allow you to disable advisor rules for your project from the{' '}
  28. <InlineLink
  29. href={
  30. isAdvisorRulesEnabled
  31. ? `/project/${ref}/advisors/rules/security`
  32. : `/project/${ref}/advisors/security`
  33. }
  34. >
  35. Advisors section.
  36. </InlineLink>
  37. </li>
  38. </ul>
  39. </div>
  40. </div>
  41. )
  42. }