bolt.diy/app/layout/header/components/HeaderActionButtons.client.tsx
KevIsDev 6913e9471f refactor: move workbench components and stores to its own directory structure
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
2025-06-20 15:40:44 +01:00

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>
);
}