AdvisorRules.tsx23 lines · main
| 1 | import { lintInfoMap } from '../Linter/Linter.utils' |
| 2 | import { AdvisorRuleItem } from './AdvisorRuleItem' |
| 3 | import { ScaffoldContainer, ScaffoldSection } from '@/components/layouts/Scaffold' |
| 4 | |
| 5 | interface AdvisorRulesProps { |
| 6 | category: 'security' | 'performance' |
| 7 | } |
| 8 | |
| 9 | export const AdvisorRules = ({ category }: AdvisorRulesProps) => { |
| 10 | const lints = lintInfoMap.filter((x) => x.category === category) |
| 11 | |
| 12 | return ( |
| 13 | <ScaffoldContainer> |
| 14 | <ScaffoldSection isFullWidth className="pt-6!"> |
| 15 | <div className="[&>div:first-child>div]:rounded-t [&>div:last-child>div]:border-b [&>div:last-child>div]:rounded-b"> |
| 16 | {lints.map((lint) => ( |
| 17 | <AdvisorRuleItem key={lint.name} lint={lint} /> |
| 18 | ))} |
| 19 | </div> |
| 20 | </ScaffoldSection> |
| 21 | </ScaffoldContainer> |
| 22 | ) |
| 23 | } |