From df3484bdebd7c039d92efe384798d94d10190b43 Mon Sep 17 00:00:00 2001 From: n4ze3m Date: Tue, 23 Jul 2024 11:14:45 +0530 Subject: [PATCH] feat: Truncate long titles in PromptBody component and improve rendering of system and quick prompts --- src/components/Option/Prompt/index.tsx | 33 +++++++++++++------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/components/Option/Prompt/index.tsx b/src/components/Option/Prompt/index.tsx index a862fc2..141bdf6 100644 --- a/src/components/Option/Prompt/index.tsx +++ b/src/components/Option/Prompt/index.tsx @@ -126,30 +126,31 @@ export const PromptBody = () => { { title: t("managePrompts.columns.title"), dataIndex: "title", - key: "title" + key: "title", + render: (content) => ({content}) }, { title: t("managePrompts.columns.prompt"), dataIndex: "content", - key: "content" + key: "content", + render: (content) => ({content}) }, { title: t("managePrompts.columns.type"), dataIndex: "is_system", key: "is_system", render: (is_system) => - is_system ? ( - - - {t("managePrompts.systemPrompt")} - - ) : ( - - - {t("managePrompts.quickPrompt")} - - ) - }, + + {is_system ? ( + <> + {t("managePrompts.systemPrompt")} + + ) : ( + <> + {t("managePrompts.quickPrompt")} + + )} + }, { title: t("managePrompts.columns.actions"), render: (_, record) => ( @@ -164,7 +165,7 @@ export const PromptBody = () => { } }} className="text-red-500 dark:text-red-400"> - + @@ -175,7 +176,7 @@ export const PromptBody = () => { setOpenEdit(true) }} className="text-gray-500 dark:text-gray-400"> - +