import { useCanvasGraphContext } from "../../contexts/CanvasGraphContext"; import { useCanvasQuickActions } from "../../hooks/useCanvasQuickActions"; import type { QuickAction } from "../../types/quick-action"; import { getCurrentArtifactContent, isCodeArtifact } from "../../utils/artifact"; import { QUICK_ACTIONS_CODE, QUICK_ACTIONS_TEXT } from "../../constants"; export function CanvasQuickActionBar() { const { artifact, isStreaming } = useCanvasGraphContext(); const { triggerQuickAction } = useCanvasQuickActions(); const content = getCurrentArtifactContent(artifact); if (!content) return null; const actions: QuickAction[] = isCodeArtifact(content) ? QUICK_ACTIONS_CODE : QUICK_ACTIONS_TEXT; return (
{actions.map((action) => ( ))}
); }