diff --git a/examples/excel-master/components/chatbot-page.tsx b/examples/excel-master/components/chatbot-page.tsx index 80203378..6bb22308 100755 --- a/examples/excel-master/components/chatbot-page.tsx +++ b/examples/excel-master/components/chatbot-page.tsx @@ -7,6 +7,8 @@ import { useState } from 'react' import { toast } from 'sonner' import { ChatInput } from './chat-input' import { Opening } from './opening' +import { Suggestions } from './suggestions' + export interface ChatProps extends React.ComponentProps<'div'> { id?: string // Optional: Thread ID if you want to persist the chat in a DB @@ -31,6 +33,11 @@ export function Chatbot({ id, initialMessages, className }: ChatProps) { setThreadId(lbThreadId) } }) + + const sendSuggestedPrompt = (prompt: string) => { + setInput(prompt) + } + return (
@@ -39,7 +46,10 @@ export function Chatbot({ id, initialMessages, className }: ChatProps) { ) : ( - + <> + + + )}
{ @@ -49,7 +51,19 @@ export function PromptForm({ className="text-muted-foreground/50 h-5 w-5" aria-hidden="true" /> -

Chat

+

Ask

+ + + + + +
    +
  • Say Hello to start a conversation, or simply describe your spreadsheet problem in detail.
  • +
  • ExcelMaster is an AI assistant that specializes in Excel formulas. It provides easy-to-understand, step-by-step solutions using Excel formulas, along with tips and optimizations.
  • +
  • To get the best results, try to provide simple, clear and step-by-step instruction to your spreadsheet problem.
  • +
+
+
diff --git a/examples/excel-master/components/suggestions.tsx b/examples/excel-master/components/suggestions.tsx new file mode 100644 index 00000000..a93eb44d --- /dev/null +++ b/examples/excel-master/components/suggestions.tsx @@ -0,0 +1,52 @@ +import cn from 'mxcn' +import { IconSparkles } from './ui/icons' + +// Prompt suggestions – Change these to match your use-case/company +const suggestions = [ + { + title: `Say hello to begin conversation`, + prompt: `Hello` + }, + { + title: `Provide an example on how to use ExcelMaster`, + prompt: `Provide an example on how to use your services` + }, +] + +export const Suggestions = ({ + sendSuggestedPrompt +}: { + sendSuggestedPrompt: (prompt: string) => void +}) => { + const handleClick = (prompt: string) => { + sendSuggestedPrompt(prompt) + } + + return ( +
+ +
+ {suggestions.map((suggestion, index) => { + return ( +
handleClick(suggestion.prompt)} + > +
+ ) + })} +
+
+ ) +} \ No newline at end of file diff --git a/examples/excel-master/components/ui/hovercard.tsx b/examples/excel-master/components/ui/hovercard.tsx new file mode 100644 index 00000000..cc819857 --- /dev/null +++ b/examples/excel-master/components/ui/hovercard.tsx @@ -0,0 +1,29 @@ +"use client" + +import * as React from "react" +import * as HoverCardPrimitive from "@radix-ui/react-hover-card" + +import cn from 'mxcn' + +const HoverCard = HoverCardPrimitive.Root + +const HoverCardTrigger = HoverCardPrimitive.Trigger + +const HoverCardContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, align = "center", sideOffset = 4, ...props }, ref) => ( + +)) +HoverCardContent.displayName = HoverCardPrimitive.Content.displayName + +export { HoverCard, HoverCardTrigger, HoverCardContent } \ No newline at end of file diff --git a/examples/excel-master/package.json b/examples/excel-master/package.json index 68198a42..196d064b 100755 --- a/examples/excel-master/package.json +++ b/examples/excel-master/package.json @@ -9,6 +9,7 @@ "lint": "next lint" }, "dependencies": { + "@radix-ui/react-hover-card": "^1.1.1", "@radix-ui/react-label": "^2.0.2", "@radix-ui/react-separator": "^1.0.3", "@radix-ui/react-slot": "^1.0.2",