@ -3,7 +3,9 @@ import {
BookOpenTextIcon ,
BookOpenTextIcon ,
BrainIcon ,
BrainIcon ,
ChevronDownIcon ,
ChevronDownIcon ,
ListIcon ,
NotebookPenIcon ,
NotebookPenIcon ,
PencilLine ,
type LucideIcon ,
type LucideIcon ,
} from 'lucide-react' ;
} from 'lucide-react' ;
import { cn } from '../../lib/classname' ;
import { cn } from '../../lib/classname' ;
@ -23,9 +25,20 @@ export const actions: PredefinedActionType[] = [
children : [
children : [
{
{
icon : NotebookPenIcon ,
icon : NotebookPenIcon ,
label : 'Explain T opic' ,
label : 'Explain the t opic' ,
prompt : 'Explain this topic in detail and include examples' ,
prompt : 'Explain this topic in detail and include examples' ,
} ,
} ,
{
icon : ListIcon ,
label : 'List the key points' ,
prompt : 'List the key points to remember from this topic' ,
} ,
{
icon : PencilLine ,
label : 'Summarize the topic' ,
prompt :
'Briefly explain the topic in a few sentences. Treat it as a brief answer to an interview question. Your response should just be the answer to the question, nothing else.' ,
} ,
{
{
icon : BabyIcon ,
icon : BabyIcon ,
label : 'Explain like I am five' ,
label : 'Explain like I am five' ,
@ -46,6 +59,15 @@ export const promptLabelMapping = actions.reduce(
if ( action . prompt ) {
if ( action . prompt ) {
acc [ action . prompt ] = action . label ;
acc [ action . prompt ] = action . label ;
}
}
if ( action . children ) {
action . children . forEach ( ( child ) = > {
if ( child . prompt ) {
acc [ child . prompt ] = child . label ;
}
} ) ;
}
return acc ;
return acc ;
} ,
} ,
{ } as Record < string , string > ,
{ } as Record < string , string > ,
@ -107,7 +129,7 @@ export function PredefinedActionButton(props: PredefinedActionButtonProps) {
) }
) }
onClick = { onClick }
onClick = { onClick }
>
>
{ Icon && < Icon className = "size-3.5" / > }
{ Icon && < Icon className = "size-3.5 mr-1 " / > }
{ label }
{ label }
{ isGroup && < ChevronDownIcon className = "size-3.5" / > }
{ isGroup && < ChevronDownIcon className = "size-3.5" / > }
< / button >
< / button >