@@ -6,9 +6,17 @@ import styled from 'styled-components'
6
6
7
7
export const EmptyState = memo ( ( ) => {
8
8
const { t } = useTranslation ( )
9
- const { openFolderDialog } = useOpen ( )
9
+ const { openFolderDialog, openFile } = useOpen ( )
10
10
11
11
const startNavItems = [
12
+ {
13
+ name : t ( 'file.openDir' ) ,
14
+ action : openFolderDialog ,
15
+ } ,
16
+ {
17
+ name : t ( 'file.openFile' ) ,
18
+ action : openFile ,
19
+ } ,
12
20
{
13
21
name : t ( 'action.create_file' ) ,
14
22
action : ( ) =>
@@ -17,21 +25,16 @@ export const EmptyState = memo(() => {
17
25
content : '' ,
18
26
} ) ,
19
27
} ,
20
- {
21
- name : t ( 'file.openDir' ) ,
22
- action : openFolderDialog ,
23
- } ,
24
28
]
25
29
26
30
return (
27
31
< Container className = 'w-full h-full' >
28
32
< div >
29
- < p className = 'nav-title' > { t ( 'file.emptyOpened' ) } </ p >
30
33
< div className = 'nav-list' >
31
34
{ startNavItems . map ( ( item ) => (
32
- < div className = 'nav-list__item' key = { item . name } onClick = { item . action } >
35
+ < ActionButton key = { item . name } onClick = { item . action } >
33
36
{ item . name }
34
- </ div >
37
+ </ ActionButton >
35
38
) ) }
36
39
</ div >
37
40
</ div >
@@ -57,7 +60,7 @@ const Container = styled.div`
57
60
align-items: center;
58
61
justify-content: center;
59
62
gap: 8px;
60
- min-width: 160px ;
63
+ min-width: 180px ;
61
64
62
65
&__item {
63
66
width: 100%;
@@ -66,3 +69,23 @@ const Container = styled.div`
66
69
}
67
70
}
68
71
`
72
+
73
+ const ActionButton = styled . button `
74
+ width: 100%;
75
+ display: flex;
76
+ align-items: center;
77
+ justify-content: center;
78
+ padding: 8px 16px;
79
+ border: none;
80
+ border-radius: 4px;
81
+ font-size: 14px;
82
+ font-weight: 500;
83
+ cursor: pointer;
84
+ transition: all 0.3s ease;
85
+ background-color: ${ ( props ) => props . theme . bgColorSecondary } ;
86
+ color: ${ ( props ) => props . theme . primaryFontColor } ;
87
+
88
+ &:hover {
89
+ background-color: ${ ( props ) => props . theme . hoverColor } ;
90
+ }
91
+ `
0 commit comments