@@ -16,9 +16,9 @@ import {
1616} from "react-admin" ;
1717import { useWatch } from "react-hook-form" ;
1818import { Prism as SyntaxHighlighter } from "react-syntax-highlighter" ;
19+
1920// import { PrismLight as SyntaxHighlighter } from "react-syntax-highlighter";
2021// import rego from "react-syntax-highlighter/dist/esm/languages/prism/rego";
21- import { oneDark , oneLight } from "react-syntax-highlighter/dist/esm/styles/prism" ;
2222
2323import MarkdownEdit from "../commons/custom_fields/MarkdownEdit" ;
2424import MarkdownField from "../commons/custom_fields/MarkdownField" ;
@@ -33,6 +33,7 @@ import {
3333import {
3434 feature_general_rules_need_approval_enabled ,
3535 feature_vex_enabled ,
36+ getPrismTheme ,
3637 justificationIsEnabledForStatus ,
3738 remediationsAreEnabledForStatus ,
3839 settings_vex_justification_style ,
@@ -45,7 +46,6 @@ import {
4546 useStyles ,
4647} from "../commons/layout/themes" ;
4748import { VEX_JUSTIFICATION_TYPE_CSAF_OPENVEX , VEX_JUSTIFICATION_TYPE_CYCLONEDX } from "../commons/types" ;
48- import { getResolvedSettingTheme } from "../commons/user_settings/functions" ;
4949import {
5050 OBSERVATION_CYCLONEDX_VEX_JUSTIFICATION_CHOICES ,
5151 OBSERVATION_SEVERITY_CHOICES ,
@@ -58,15 +58,6 @@ import { RULE_TYPE_CHOICES, RULE_TYPE_FIELDS, RULE_TYPE_REGO } from "./types";
5858
5959// SyntaxHighlighter.registerLanguage("rego", rego);
6060
61- export function getRegoTheme ( ) {
62- const theme = getResolvedSettingTheme ( ) ;
63- if ( theme === "dark" ) {
64- return oneDark ;
65- } else {
66- return oneLight ;
67- }
68- }
69-
7061export const validateRuleForm = ( values : any ) => {
7162 const errors : any = { } ;
7263
@@ -196,7 +187,7 @@ export const RuleShowComponent = ({ rule }: any) => {
196187 < Labeled label = "Rego module" >
197188 < SyntaxHighlighter
198189 language = "rego"
199- style = { getRegoTheme ( ) }
190+ style = { getPrismTheme ( ) }
200191 wrapLongLines
201192 customStyle = { { lineHeight : "1.43" , fontSize : "0.875rem" } }
202193 codeTagProps = { {
0 commit comments