Skip to content

Commit

Permalink
add save & load buttons (not connected)
Browse files Browse the repository at this point in the history
link buttons to only custom script
  • Loading branch information
nicarq committed Sep 21, 2024
1 parent a253956 commit 2d6e908
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions apps/shinkai-desktop/src/pages/workflow-playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,7 @@ const WorkflowPlayground = () => {
[onWorkflowChange],
);

const [selectedTab, setSelectedTab] = useState<'workflow' | 'baml'>(
'baml',
);
const [selectedTab, setSelectedTab] = useState<'workflow' | 'baml'>('baml');
const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);

// **New State for BAML Script Selection and Data**
Expand Down Expand Up @@ -394,6 +392,14 @@ function ClassifyMessage(message_text: string) -> Message {
}));
};

const handleSave = () => {
// Implement save functionality
};

const handleLoad = () => {
// Implement load functionality
};

return (
<SubpageLayout
className="max-w-[auto] px-3"
Expand Down Expand Up @@ -738,6 +744,26 @@ function ClassifyMessage(message_text: string) -> Message {
>
Classify Message
</Button>

{/* Save and Load Buttons */}
{selectedBamlScript === 'my' && (
<div className="ml-auto flex gap-2">
<Button
className="px-3 py-1.5 text-sm"
onClick={handleSave}
variant="outline"
>
Save
</Button>
<Button
className="px-3 py-1.5 text-sm"
onClick={handleLoad}
variant="outline"
>
Load
</Button>
</div>
)}
</div>

{/* Layout Switch Button */}
Expand Down

0 comments on commit 2d6e908

Please sign in to comment.