mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-06-26 18:26:38 +00:00
Restructure the workbench module by moving components and stores from shared/workbench to workbench directory. This includes terminal components, editor utilities, preview stores, and UI components. Update all import paths to reflect the new structure. The changes include: - Moving terminal components and theme files - Relocating editor utilities like EnvMasking and indent - Transferring stores for previews, editor, and terminal - Updating all affected import statements across the codebase - Moving UI components like PortDropdown and Inspector
29 lines
1.1 KiB
TypeScript
29 lines
1.1 KiB
TypeScript
import { useStore } from '@nanostores/react';
|
|
import { workbenchStore } from '~/workbench/stores/workbench';
|
|
import { useState } from 'react';
|
|
import { streamingState } from '~/shared/stores/streaming';
|
|
import { ExportChatButton } from '~/chat/components/chatExportAndImport/ExportChatButton';
|
|
import { useChatHistory } from '~/shared/lib/persistence';
|
|
import { DeployButton } from '~/layout/header/components/DeployButton';
|
|
|
|
interface HeaderActionButtonsProps {
|
|
chatStarted: boolean;
|
|
}
|
|
|
|
export function HeaderActionButtons({ chatStarted }: HeaderActionButtonsProps) {
|
|
const [activePreviewIndex] = useState(0);
|
|
const previews = useStore(workbenchStore.previews);
|
|
const activePreview = previews[activePreviewIndex];
|
|
const isStreaming = useStore(streamingState);
|
|
const { exportChat } = useChatHistory();
|
|
|
|
const shouldShowButtons = !isStreaming && activePreview;
|
|
|
|
return (
|
|
<div className="flex items-center">
|
|
{chatStarted && shouldShowButtons && <ExportChatButton exportChat={exportChat} />}
|
|
{shouldShowButtons && <DeployButton />}
|
|
</div>
|
|
);
|
|
}
|