From a73bab89d986e6b34f731729f6e3890a1c6d65ac Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Mon, 30 Mar 2026 20:31:19 +0200 Subject: [PATCH] add see more/less toggle on prompt cards for long content --- .../components/CommunityPromptsContent.tsx | 22 ++++++++++++++----- .../components/PromptsContent.tsx | 14 +++++++++++- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/CommunityPromptsContent.tsx b/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/CommunityPromptsContent.tsx index 4ae47dbfc..363919b43 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/CommunityPromptsContent.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/CommunityPromptsContent.tsx @@ -12,6 +12,7 @@ export function CommunityPromptsContent() { const [prompts, setPrompts] = useState([]); const [isLoading, setIsLoading] = useState(true); const [copyingId, setCopyingId] = useState(null); + const [expandedId, setExpandedId] = useState(null); useEffect(() => { promptsApiService @@ -73,12 +74,23 @@ export function CommunityPromptsContent() { {prompt.mode} + {prompt.author_name && ( + + by {prompt.author_name} + + )} -

{prompt.prompt}

- {prompt.author_name && ( -

- by {prompt.author_name} -

+

+ {prompt.prompt} +

+ {prompt.prompt.length > 100 && ( + )} + )}