mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-30 19:06:23 +02:00
copilot prompt for prebuilt cards can be configured per card
This commit is contained in:
parent
eec92bbd39
commit
c41e65d7a5
10 changed files with 32 additions and 22 deletions
|
|
@ -107,13 +107,14 @@ export function BuildAssistantSection() {
|
|||
};
|
||||
|
||||
// Handle template selection
|
||||
const handleTemplateSelect = async (templateId: string) => {
|
||||
const handleTemplateSelect = async (template: any) => {
|
||||
// Show a small non-blocking spinner on the clicked card
|
||||
setLoadingTemplateId(templateId);
|
||||
setLoadingTemplateId(template.id);
|
||||
try {
|
||||
await createProjectWithOptions({
|
||||
template: templateId,
|
||||
prompt: 'Explain this workflow',
|
||||
template: template.id,
|
||||
// Prefer a card-specific copilot prompt if present on the template JSON
|
||||
prompt: template.copilotPrompt || 'Explain this workflow',
|
||||
router,
|
||||
onError: () => {
|
||||
// Clear loading state if creation fails
|
||||
|
|
@ -499,7 +500,7 @@ export function BuildAssistantSection() {
|
|||
{items.map((template) => (
|
||||
<button
|
||||
key={template.id}
|
||||
onClick={() => handleTemplateSelect(template.id)}
|
||||
onClick={() => handleTemplateSelect(template)}
|
||||
disabled={loadingTemplateId === template.id}
|
||||
className={clsx(
|
||||
"relative block p-4 border border-gray-200 dark:border-gray-700 rounded-xl transition-all group text-left",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue