|
1 | 1 | 'use client' |
2 | 2 |
|
3 | 3 | import { lazy, memo, Suspense, useCallback, useEffect, useMemo, useRef, useState } from 'react' |
4 | | -import { Button, OverflowText, PlayOutline, Skeleton, Tooltip, toast } from '@sim/emcn' |
| 4 | +import { OverflowText, PlayOutline, Skeleton, TabStripAction, Tooltip, toast } from '@sim/emcn' |
5 | 5 | import { |
6 | 6 | Download, |
7 | 7 | FileX, |
@@ -36,10 +36,7 @@ import type { BrowserPanelOverlayController } from '@/app/workspace/[workspaceId |
36 | 36 | import { BrowserSession } from '@/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content/components/browser-session/browser-session' |
37 | 37 | import { GenericResourceContent } from '@/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content/components/generic-resource-content' |
38 | 38 | import { TerminalSession } from '@/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content/components/terminal-session/terminal-session' |
39 | | -import { |
40 | | - RESOURCE_TAB_ICON_BUTTON_CLASS, |
41 | | - RESOURCE_TAB_ICON_CLASS, |
42 | | -} from '@/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-tabs/resource-tab-controls' |
| 39 | +import { RESOURCE_TAB_ICON_CLASS } from '@/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-tabs/resource-tab-controls' |
43 | 40 | import { hasRenderableFilePreviewContent } from '@/app/workspace/[workspaceId]/home/hooks/preview' |
44 | 41 | import type { |
45 | 42 | GenericResourceData, |
@@ -465,34 +462,28 @@ export function EmbeddedWorkflowActions({ workspaceId, workflowId }: EmbeddedWor |
465 | 462 | <> |
466 | 463 | <Tooltip.Root> |
467 | 464 | <Tooltip.Trigger asChild> |
468 | | - <Button |
469 | | - variant='subtle' |
470 | | - onClick={handleOpenWorkflow} |
471 | | - className={RESOURCE_TAB_ICON_BUTTON_CLASS} |
472 | | - aria-label='Open workflow' |
473 | | - > |
| 465 | + <TabStripAction variant='subtle' onClick={handleOpenWorkflow} aria-label='Open workflow'> |
474 | 466 | <SquareArrowUpRight className={RESOURCE_TAB_ICON_CLASS} /> |
475 | | - </Button> |
| 467 | + </TabStripAction> |
476 | 468 | </Tooltip.Trigger> |
477 | 469 | <Tooltip.Content side='bottom'> |
478 | 470 | <p>Open workflow</p> |
479 | 471 | </Tooltip.Content> |
480 | 472 | </Tooltip.Root> |
481 | 473 | <Tooltip.Root> |
482 | 474 | <Tooltip.Trigger asChild> |
483 | | - <Button |
| 475 | + <TabStripAction |
484 | 476 | variant='subtle' |
485 | 477 | onClick={() => void handleRun()} |
486 | 478 | disabled={isRunButtonDisabled} |
487 | | - className={RESOURCE_TAB_ICON_BUTTON_CLASS} |
488 | 479 | aria-label={isExecuting ? 'Stop workflow' : 'Run workflow'} |
489 | 480 | > |
490 | 481 | {isExecuting ? ( |
491 | 482 | <Square className={RESOURCE_TAB_ICON_CLASS} /> |
492 | 483 | ) : ( |
493 | 484 | <PlayOutline className={RESOURCE_TAB_ICON_CLASS} /> |
494 | 485 | )} |
495 | | - </Button> |
| 486 | + </TabStripAction> |
496 | 487 | </Tooltip.Trigger> |
497 | 488 | <Tooltip.Content side='bottom'> |
498 | 489 | <p>{isExecuting ? 'Stop' : 'Run workflow'}</p> |
@@ -520,14 +511,13 @@ export function EmbeddedKnowledgeBaseActions({ |
520 | 511 | return ( |
521 | 512 | <Tooltip.Root> |
522 | 513 | <Tooltip.Trigger asChild> |
523 | | - <Button |
| 514 | + <TabStripAction |
524 | 515 | variant='subtle' |
525 | 516 | onClick={handleOpenKnowledgeBase} |
526 | | - className={RESOURCE_TAB_ICON_BUTTON_CLASS} |
527 | 517 | aria-label='Open knowledge base' |
528 | 518 | > |
529 | 519 | <SquareArrowUpRight className={RESOURCE_TAB_ICON_CLASS} /> |
530 | | - </Button> |
| 520 | + </TabStripAction> |
531 | 521 | </Tooltip.Trigger> |
532 | 522 | <Tooltip.Content side='bottom'> |
533 | 523 | <p>Open knowledge base</p> |
@@ -562,29 +552,23 @@ function EmbeddedTableActions({ workspaceId, tableId }: EmbeddedTableActionsProp |
562 | 552 | <> |
563 | 553 | <Tooltip.Root> |
564 | 554 | <Tooltip.Trigger asChild> |
565 | | - <Button |
566 | | - variant='subtle' |
567 | | - onClick={handleOpenTable} |
568 | | - className={RESOURCE_TAB_ICON_BUTTON_CLASS} |
569 | | - aria-label='Open table' |
570 | | - > |
| 555 | + <TabStripAction variant='subtle' onClick={handleOpenTable} aria-label='Open table'> |
571 | 556 | <SquareArrowUpRight className={RESOURCE_TAB_ICON_CLASS} /> |
572 | | - </Button> |
| 557 | + </TabStripAction> |
573 | 558 | </Tooltip.Trigger> |
574 | 559 | <Tooltip.Content side='bottom'> |
575 | 560 | <p>Open table</p> |
576 | 561 | </Tooltip.Content> |
577 | 562 | </Tooltip.Root> |
578 | 563 | <Tooltip.Root> |
579 | 564 | <Tooltip.Trigger asChild> |
580 | | - <Button |
| 565 | + <TabStripAction |
581 | 566 | variant='subtle' |
582 | 567 | onClick={() => void handleExport()} |
583 | | - className={RESOURCE_TAB_ICON_BUTTON_CLASS} |
584 | 568 | aria-label='Export table as CSV' |
585 | 569 | > |
586 | 570 | <Download className={RESOURCE_TAB_ICON_CLASS} /> |
587 | | - </Button> |
| 571 | + </TabStripAction> |
588 | 572 | </Tooltip.Trigger> |
589 | 573 | <Tooltip.Content side='bottom'> |
590 | 574 | <p>Export CSV</p> |
@@ -639,30 +623,24 @@ function EmbeddedFileActions({ |
639 | 623 | <> |
640 | 624 | <Tooltip.Root> |
641 | 625 | <Tooltip.Trigger asChild> |
642 | | - <Button |
643 | | - variant='subtle' |
644 | | - onClick={handleOpenInFiles} |
645 | | - className={RESOURCE_TAB_ICON_BUTTON_CLASS} |
646 | | - aria-label='Open in files' |
647 | | - > |
| 626 | + <TabStripAction variant='subtle' onClick={handleOpenInFiles} aria-label='Open in files'> |
648 | 627 | <SquareArrowUpRight className={RESOURCE_TAB_ICON_CLASS} /> |
649 | | - </Button> |
| 628 | + </TabStripAction> |
650 | 629 | </Tooltip.Trigger> |
651 | 630 | <Tooltip.Content side='bottom'> |
652 | 631 | <p>Open in files</p> |
653 | 632 | </Tooltip.Content> |
654 | 633 | </Tooltip.Root> |
655 | 634 | <Tooltip.Root> |
656 | 635 | <Tooltip.Trigger asChild> |
657 | | - <Button |
| 636 | + <TabStripAction |
658 | 637 | variant='subtle' |
659 | 638 | onClick={() => void handleDownload()} |
660 | 639 | disabled={!file} |
661 | | - className={RESOURCE_TAB_ICON_BUTTON_CLASS} |
662 | 640 | aria-label='Download file' |
663 | 641 | > |
664 | 642 | <Download className={RESOURCE_TAB_ICON_CLASS} /> |
665 | | - </Button> |
| 643 | + </TabStripAction> |
666 | 644 | </Tooltip.Trigger> |
667 | 645 | <Tooltip.Content side='bottom'> |
668 | 646 | <p>Download</p> |
@@ -896,14 +874,9 @@ export function EmbeddedLogActions({ workspaceId, logId }: EmbeddedLogActionsPro |
896 | 874 | return ( |
897 | 875 | <Tooltip.Root> |
898 | 876 | <Tooltip.Trigger asChild> |
899 | | - <Button |
900 | | - variant='subtle' |
901 | | - onClick={handleOpenInLogs} |
902 | | - className={RESOURCE_TAB_ICON_BUTTON_CLASS} |
903 | | - aria-label='Open in logs' |
904 | | - > |
| 877 | + <TabStripAction variant='subtle' onClick={handleOpenInLogs} aria-label='Open in logs'> |
905 | 878 | <SquareArrowUpRight className={RESOURCE_TAB_ICON_CLASS} /> |
906 | | - </Button> |
| 879 | + </TabStripAction> |
907 | 880 | </Tooltip.Trigger> |
908 | 881 | <Tooltip.Content side='bottom'> |
909 | 882 | <p>Open in logs</p> |
|
0 commit comments