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