import { Center, Grid, SegmentedControl, Text, Title, Box, Badge, Space, ActionIcon } from '@mantine/core'; import React from 'react'; import { RegexFilter } from '../../js/models'; import { getHumanReadableRegex } from '../../js/utils'; import style from "./RegexView.module.scss"; import { FaListAlt } from "react-icons/fa" import { TiCancel } from "react-icons/ti" import { BsTrashFill } from "react-icons/bs" function RegexView({ regexInfo }:{ regexInfo:RegexFilter }) { const mode_string = regexInfo.mode == "C"? "C -> S": regexInfo.mode == "S"? "S -> C": regexInfo.mode == "B"? "S <-> C": "🤔" let regex_expr = getHumanReadableRegex(regexInfo.regex); let exact_regex = true; if (regex_expr.length>=4 && regex_expr.startsWith(".*") && regex_expr.endsWith(".*")){ regex_expr = regex_expr.substring(2,regex_expr.length-2) exact_regex = false; } return