|
1 | 1 | 'use client' |
2 | 2 |
|
3 | 3 | import { lazy, memo, Suspense, useCallback, useEffect, useMemo, useRef, useState } from 'react' |
4 | | -import { OverflowText, PlayOutline, Skeleton, TabStripAction, Tooltip, toast } from '@sim/emcn' |
| 4 | +import { |
| 5 | + OverflowText, |
| 6 | + PlayOutline, |
| 7 | + ResourceEmptyState, |
| 8 | + Skeleton, |
| 9 | + TabStripAction, |
| 10 | + Tooltip, |
| 11 | + toast, |
| 12 | +} from '@sim/emcn' |
5 | 13 | import { |
6 | 14 | Download, |
7 | 15 | FileX, |
@@ -666,17 +674,11 @@ function EmbeddedWorkflow({ workspaceId, workflowId }: EmbeddedWorkflowProps) { |
666 | 674 |
|
667 | 675 | if (!workflowExists || hasLoadError) { |
668 | 676 | return ( |
669 | | - <div className='flex h-full flex-col items-center justify-center gap-3'> |
670 | | - <WorkflowX className='size-[32px] text-[var(--text-icon)]' /> |
671 | | - <div className='flex flex-col items-center gap-1'> |
672 | | - <h2 className='text-[var(--text-primary)] text-xl leading-[inherit]'> |
673 | | - Workflow not found |
674 | | - </h2> |
675 | | - <p className='text-[var(--text-body)] text-small'> |
676 | | - This workflow may have been deleted or moved |
677 | | - </p> |
678 | | - </div> |
679 | | - </div> |
| 677 | + <ResourceEmptyState |
| 678 | + icon={WorkflowX} |
| 679 | + title='Workflow not found' |
| 680 | + description='This workflow may have been deleted or moved' |
| 681 | + /> |
680 | 682 | ) |
681 | 683 | } |
682 | 684 |
|
@@ -731,15 +733,11 @@ function EmbeddedFile({ |
731 | 733 |
|
732 | 734 | if (!file) { |
733 | 735 | return ( |
734 | | - <div className='flex h-full flex-col items-center justify-center gap-3'> |
735 | | - <FileX className='size-[32px] text-[var(--text-icon)]' /> |
736 | | - <div className='flex flex-col items-center gap-1'> |
737 | | - <h2 className='text-[var(--text-primary)] text-xl leading-[inherit]'>File not found</h2> |
738 | | - <p className='text-[var(--text-body)] text-small'> |
739 | | - This file may have been deleted or moved |
740 | | - </p> |
741 | | - </div> |
742 | | - </div> |
| 736 | + <ResourceEmptyState |
| 737 | + icon={FileX} |
| 738 | + title='File not found' |
| 739 | + description='This file may have been deleted or moved' |
| 740 | + /> |
743 | 741 | ) |
744 | 742 | } |
745 | 743 |
|
@@ -782,15 +780,11 @@ function EmbeddedFolder({ workspaceId, folderId }: EmbeddedFolderProps) { |
782 | 780 |
|
783 | 781 | if (!folder) { |
784 | 782 | return ( |
785 | | - <div className='flex h-full flex-col items-center justify-center gap-3'> |
786 | | - <FolderIcon className='size-[32px] text-[var(--text-icon)]' /> |
787 | | - <div className='flex flex-col items-center gap-1'> |
788 | | - <h2 className='text-[var(--text-primary)] text-xl leading-[inherit]'>Folder not found</h2> |
789 | | - <p className='text-[var(--text-body)] text-small'> |
790 | | - This folder may have been deleted or moved |
791 | | - </p> |
792 | | - </div> |
793 | | - </div> |
| 783 | + <ResourceEmptyState |
| 784 | + icon={FolderIcon} |
| 785 | + title='Folder not found' |
| 786 | + description='This folder may have been deleted or moved' |
| 787 | + /> |
794 | 788 | ) |
795 | 789 | } |
796 | 790 |
|
@@ -840,15 +834,11 @@ function EmbeddedLog({ workspaceId, logId, onNotFound }: EmbeddedLogProps) { |
840 | 834 |
|
841 | 835 | if (!log) { |
842 | 836 | return ( |
843 | | - <div className='flex h-full flex-col items-center justify-center gap-3'> |
844 | | - <Library className='size-[32px] text-[var(--text-icon)]' /> |
845 | | - <div className='flex flex-col items-center gap-1'> |
846 | | - <h2 className='text-[var(--text-primary)] text-xl leading-[inherit]'>Log not found</h2> |
847 | | - <p className='text-[var(--text-body)] text-small'> |
848 | | - This log may have been deleted or is no longer available |
849 | | - </p> |
850 | | - </div> |
851 | | - </div> |
| 837 | + <ResourceEmptyState |
| 838 | + icon={Library} |
| 839 | + title='Log not found' |
| 840 | + description='This log may have been deleted or is no longer available' |
| 841 | + /> |
852 | 842 | ) |
853 | 843 | } |
854 | 844 |
|
|
0 commit comments