@@ -22,17 +22,19 @@ import { getDisplayStatus } from "../../util/workspace"
22
22
dayjs . extend ( relativeTime )
23
23
24
24
export const Language = {
25
- createButton : "Create workspace" ,
26
- emptyMessage : "Create your first workspace" ,
27
- emptyDescription : "Start editing your source code and building your software" ,
25
+ createWorkspaceButton : "Create workspace" ,
26
+ emptyCreateWorkspaceMessage : "Create your first workspace" ,
27
+ emptyCreateWorkspaceDescription : "Start editing your source code and building your software" ,
28
+ emptyResultsMessage : "No results matched your search" ,
28
29
}
29
30
30
31
export interface WorkspacesPageViewProps {
31
32
loading ?: boolean
32
33
workspaces ?: TypesGen . Workspace [ ]
34
+ query ?: string
33
35
}
34
36
35
- export const WorkspacesPageView : FC < WorkspacesPageViewProps > = ( { loading, workspaces } ) => {
37
+ export const WorkspacesPageView : FC < WorkspacesPageViewProps > = ( { loading, workspaces, query } ) => {
36
38
useStyles ( )
37
39
const theme : Theme = useTheme ( )
38
40
@@ -51,19 +53,31 @@ export const WorkspacesPageView: FC<WorkspacesPageViewProps> = ({ loading, works
51
53
< TableBody >
52
54
{ ! workspaces && loading && < TableLoader /> }
53
55
{ workspaces && workspaces . length === 0 && (
54
- < TableRow >
55
- < TableCell colSpan = { 999 } >
56
- < EmptyState
57
- message = { Language . emptyMessage }
58
- description = { Language . emptyDescription }
59
- cta = {
60
- < Link underline = "none" component = { RouterLink } to = "/workspaces/new" >
61
- < Button startIcon = { < AddCircleOutline /> } > { Language . createButton } </ Button >
62
- </ Link >
63
- }
64
- />
65
- </ TableCell >
66
- </ TableRow >
56
+ < >
57
+ { query === "owner:me" || query === "" ? (
58
+ < TableRow >
59
+ < TableCell colSpan = { 999 } >
60
+ < EmptyState
61
+ message = { Language . emptyCreateWorkspaceMessage }
62
+ description = { Language . emptyCreateWorkspaceDescription }
63
+ cta = {
64
+ < Link underline = "none" component = { RouterLink } to = "/workspaces/new" >
65
+ < Button startIcon = { < AddCircleOutline /> } > { Language . createWorkspaceButton } </ Button >
66
+ </ Link >
67
+ }
68
+ />
69
+ </ TableCell >
70
+ </ TableRow >
71
+ ) : (
72
+ < TableRow >
73
+ < TableCell colSpan = { 999 } >
74
+ < EmptyState
75
+ message = { Language . emptyResultsMessage }
76
+ />
77
+ </ TableCell >
78
+ </ TableRow >
79
+ ) }
80
+ </ >
67
81
) }
68
82
{ workspaces &&
69
83
workspaces . map ( ( workspace ) => {
0 commit comments