From 380ac4cf392f5d0722f24048113bb1293a536676 Mon Sep 17 00:00:00 2001 From: Soumyadas15 Date: Mon, 26 May 2025 16:42:48 +0530 Subject: [PATCH] chore(ui): add example section in dashboard --- .../_components/suggestions/examples.tsx | 65 +++++++++++++++ .../src/app/(dashboard)/dashboard/page.tsx | 80 ++++++++++++------- .../thread/chat-input/chat-input.tsx | 2 +- 3 files changed, 119 insertions(+), 28 deletions(-) create mode 100644 frontend/src/app/(dashboard)/dashboard/_components/suggestions/examples.tsx diff --git a/frontend/src/app/(dashboard)/dashboard/_components/suggestions/examples.tsx b/frontend/src/app/(dashboard)/dashboard/_components/suggestions/examples.tsx new file mode 100644 index 00000000..ee702679 --- /dev/null +++ b/frontend/src/app/(dashboard)/dashboard/_components/suggestions/examples.tsx @@ -0,0 +1,65 @@ +'use client'; + +import React from 'react'; +import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; +import { + BarChart3, + Bot, + Briefcase, + Settings, +} from 'lucide-react'; + +type PromptExample = { + title: string; + query: string; + icon: React.ReactNode; +}; + +const prompts: PromptExample[] = [ + { + title: 'Market research dashboard', + query: 'Create a comprehensive market research dashboard analyzing industry trends, customer segments, and competitive landscape. Include data visualization and actionable recommendations.', + icon: , + }, + { + title: 'Recommendation engine development', + query: 'Develop a recommendation engine for personalized product suggestions. Include collaborative filtering, content-based filtering, and hybrid approaches with evaluation metrics.', + icon: , + }, + { + title: 'Go-to-market strategy', + query: 'Develop a comprehensive go-to-market strategy for a new product. Include market sizing, customer acquisition channels, pricing strategy, and launch timeline.', + icon: , + }, + { + title: 'Data pipeline automation', + query: 'Create an automated data pipeline for ETL processes. Include data validation, error handling, monitoring, and scalable architecture design.', + icon: , + }, +]; + +export const Examples = ({ + onSelectPrompt, +}: { + onSelectPrompt?: (query: string) => void; +}) => { + return ( +
+
+ {prompts.map((prompt, index) => ( + onSelectPrompt && onSelectPrompt(prompt.query)} + > + +

+ {prompt.query} +

+
+
+ ))} +
+
+ ); +}; \ No newline at end of file diff --git a/frontend/src/app/(dashboard)/dashboard/page.tsx b/frontend/src/app/(dashboard)/dashboard/page.tsx index b29673ff..fd0d4b94 100644 --- a/frontend/src/app/(dashboard)/dashboard/page.tsx +++ b/frontend/src/app/(dashboard)/dashboard/page.tsx @@ -27,6 +27,7 @@ import { cn } from '@/lib/utils'; import { useInitiateAgentWithInvalidation } from '@/hooks/react-query/dashboard/use-initiate-agent'; import { ModalProviders } from '@/providers/modal-providers'; import { useModal } from '@/hooks/use-modal-store'; +import { Examples } from './_components/suggestions/examples'; const PENDING_PROMPT_KEY = 'pendingAgentPrompt'; @@ -105,7 +106,6 @@ function DashboardContent() { } }; - useEffect(() => { const timer = setTimeout(() => { const pendingPrompt = localStorage.getItem(PENDING_PROMPT_KEY); @@ -133,7 +133,7 @@ function DashboardContent() { return ( <> -
+
{isMobile && (
@@ -153,25 +153,49 @@ function DashboardContent() {
)} -
-
-

+
+
+

Hey

-

+

What would you like Suna to do today?

- - + +
+ +
+ +
-
-
- - -
- - -
- +
+
+
+ + + +
+ +
@@ -209,4 +235,4 @@ export default function DashboardPage() { ); -} +} \ No newline at end of file diff --git a/frontend/src/components/thread/chat-input/chat-input.tsx b/frontend/src/components/thread/chat-input/chat-input.tsx index bc2ce519..89994641 100644 --- a/frontend/src/components/thread/chat-input/chat-input.tsx +++ b/frontend/src/components/thread/chat-input/chat-input.tsx @@ -230,7 +230,7 @@ export const ChatInput = forwardRef( }} >
- +