4
4
BookmarkIcon as BookmarkOutline ,
5
5
EyeIcon ,
6
6
PencilIcon ,
7
- PlusIcon ,
8
7
} from "@heroicons/react/24/outline" ;
9
8
import { BookmarkIcon as BookmarkSolid } from "@heroicons/react/24/solid" ;
10
9
import {
@@ -19,11 +18,12 @@ import {
19
18
DEFAULT_PLAN_SYSTEM_MESSAGE ,
20
19
DEFAULT_SYSTEM_MESSAGES_URL ,
21
20
} from "core/llm/defaultSystemMessages" ;
21
+ import { getRuleDisplayName } from "core/llm/rules/rules-utils" ;
22
22
import { useContext , useMemo } from "react" ;
23
23
import HeaderButtonWithToolTip from "../../../components/gui/HeaderButtonWithToolTip" ;
24
24
import Switch from "../../../components/gui/Switch" ;
25
25
import { useMainEditor } from "../../../components/mainInput/TipTapEditor" ;
26
- import { Button , Card , EmptyState , useFontSize } from "../../../components/ui" ;
26
+ import { Card , EmptyState , useFontSize } from "../../../components/ui" ;
27
27
import { useAuth } from "../../../context/Auth" ;
28
28
import { IdeMessengerContext } from "../../../context/IdeMessenger" ;
29
29
import { useBookmarkedSlashCommands } from "../../../hooks/useBookmarkedSlashCommands" ;
@@ -167,27 +167,7 @@ const RuleCard: React.FC<RuleCardProps> = ({ rule }) => {
167
167
} ;
168
168
169
169
const title = useMemo ( ( ) => {
170
- if ( rule . name ) {
171
- return rule . name ;
172
- } else {
173
- if ( rule . source === ".continuerules" ) {
174
- return "Project rules" ;
175
- } else if ( rule . source === "default-chat" ) {
176
- return "Default chat system message" ;
177
- } else if ( rule . source === "default-agent" ) {
178
- return "Default agent system message" ;
179
- } else if ( rule . source === "json-systemMessage" ) {
180
- return "JSON systemMessage)" ;
181
- } else if ( rule . source === "model-options-agent" ) {
182
- return "Base System Agent Message" ;
183
- } else if ( rule . source === "model-options-plan" ) {
184
- return "Base System Plan Message" ;
185
- } else if ( rule . source === "model-options-chat" ) {
186
- return "Base System Chat Message" ;
187
- } else {
188
- return "Agent rule" ;
189
- }
190
- }
170
+ return getRuleDisplayName ( rule ) ;
191
171
} , [ rule ] ) ;
192
172
193
173
function onClickExpand ( ) {
0 commit comments