From 35ef08d794746c00206b5b00be69cfb6e4fdd9f0 Mon Sep 17 00:00:00 2001 From: zaidmukaddam Date: Sun, 25 Aug 2024 21:55:34 +0530 Subject: [PATCH] feat: Add support for displaying different icons for code snippets --- app/api/chat/route.ts | 1 + app/page.tsx | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/api/chat/route.ts b/app/api/chat/route.ts index 54ca364..a0eacca 100644 --- a/app/api/chat/route.ts +++ b/app/api/chat/route.ts @@ -237,6 +237,7 @@ When asked a "What is" question, maintain the same format as the question and an parameters: z.object({ title: z.string().optional().describe("The title of the code snippet."), code: z.string().describe("The Python code to execute."), + icon: z.enum(["stock", "date", "calculation", "default"]).describe("The icon to display for the code snippet."), }), execute: async ({ code }: { code: string }) => { const sandbox = await CodeInterpreter.create(); diff --git a/app/page.tsx b/app/page.tsx index bdc1d88..a41951f 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -50,7 +50,10 @@ import { Terminal, Pause, Play, - RotateCw + RotateCw, + TrendingUpIcon, + Calendar, + Calculator } from 'lucide-react'; import { HoverCard, @@ -801,7 +804,10 @@ export default function Home() {
- + {args.icon === 'stock' && } + {args.icon === 'default' && } + {args.icon === 'date' && } + {args.icon === 'calculation' && } {args.title}