Files
goose/ui/desktop/src/components/PopularChatTopics.tsx
Zane 77ea27f5f5 UI update with sidebar and settings tabs (#3288)
Co-authored-by: Nahiyan Khan <nahiyan@squareup.com>
Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Lily Delalande <119957291+lily-de@users.noreply.github.com>
Co-authored-by: Spence <spencrmartin@gmail.com>
Co-authored-by: spencrmartin <spencermartin@squareup.com>
Co-authored-by: Judson Stephenson <Jud@users.noreply.github.com>
Co-authored-by: Max Novich <mnovich@squareup.com>
Co-authored-by: Best Codes <106822363+The-Best-Codes@users.noreply.github.com>
Co-authored-by: caroline-a-mckenzie <cmckenzie@squareup.com>
Co-authored-by: Michael Neale <michael.neale@gmail.com>
2025-07-15 17:24:41 -07:00

77 lines
2.5 KiB
TypeScript

import React from 'react';
import { FolderTree, MessageSquare, Code } from 'lucide-react';
interface PopularChatTopicsProps {
append: (text: string) => void;
}
interface ChatTopic {
id: string;
icon: React.ReactNode;
description: string;
prompt: string;
}
const POPULAR_TOPICS: ChatTopic[] = [
{
id: 'organize-photos',
icon: <FolderTree className="w-5 h-5" />,
description: 'Organize the photos on my desktop into neat little folders by subject matter',
prompt: 'Organize the photos on my desktop into neat little folders by subject matter',
},
{
id: 'government-forms',
icon: <MessageSquare className="w-5 h-5" />,
description:
'Describe in detail how various forms of government works and rank each by units of geese',
prompt:
'Describe in detail how various forms of government works and rank each by units of geese',
},
{
id: 'tamagotchi-game',
icon: <Code className="w-5 h-5" />,
description:
'Develop a tamagotchi game that lives on my computer and follows a pixelated styling',
prompt: 'Develop a tamagotchi game that lives on my computer and follows a pixelated styling',
},
];
export default function PopularChatTopics({ append }: PopularChatTopicsProps) {
const handleTopicClick = (prompt: string) => {
append(prompt);
};
return (
<div className="absolute bottom-0 left-0 p-6 max-w-md">
<h3 className="text-text-muted text-sm mb-1">Popular chat topics</h3>
<div className="space-y-1">
{POPULAR_TOPICS.map((topic) => (
<div
key={topic.id}
className="flex items-center justify-between py-1.5 hover:bg-bgSubtle rounded-md cursor-pointer transition-colors"
onClick={() => handleTopicClick(topic.prompt)}
>
<div className="flex items-center gap-3 flex-1 min-w-0">
<div className="flex-shrink-0 text-text-muted">{topic.icon}</div>
<div className="flex-1 min-w-0">
<p className="text-text-default text-sm leading-tight">{topic.description}</p>
</div>
</div>
<div className="flex-shrink-0 ml-4">
<button
className="text-sm text-text-muted hover:text-text-default transition-colors cursor-pointer"
onClick={(e) => {
e.stopPropagation();
handleTopicClick(topic.prompt);
}}
>
Start
</button>
</div>
</div>
))}
</div>
</div>
);
}