@@ -7,28 +7,33 @@ import CodeContent from '@/components/CodeContent'
7
7
import CodeMirrorLoading from '@/components/CodeMirrorLoading'
8
8
import FixedFullscreenContainer from '@/components/FixedFullscreenContainer'
9
9
import PageTitle from '@/components/PageTitle'
10
+ import { useResponsiveDialog } from '@/components/ResponsiveDialog'
10
11
import { Button } from '@/components/ui/button'
11
- import {
12
- Dialog ,
13
- DialogContent ,
14
- DialogFooter ,
15
- DialogHeader ,
16
- DialogTitle ,
17
- } from '@/components/ui/dialog'
18
12
import { Input } from '@/components/ui/input'
19
13
import { Label } from '@/components/ui/label'
14
+ import { BottomSafeArea } from '@/components/VerticalSafeArea'
20
15
import { EvaluateResult } from '@/types'
21
16
import fetcher from '@/utils/fetcher'
22
17
23
18
const CodeMirror = lazy ( ( ) => import ( '@/components/CodeMirror' ) )
24
19
25
20
export const Component : React . FC = ( ) => {
26
21
const { t } = useTranslation ( )
22
+
23
+ const {
24
+ Dialog,
25
+ DialogContent,
26
+ DialogHeader,
27
+ DialogTitle,
28
+ DialogFooter,
29
+ DialogClose,
30
+ } = useResponsiveDialog ( )
31
+
27
32
const [ code , setCode ] = useState < string > ( ( ) =>
28
33
t ( 'scripting.editor_placeholder' ) ,
29
34
)
30
35
const [ isLoading , setIsLoading ] = useState ( false )
31
- const [ result , setResult ] = useState < string > ( )
36
+ const [ result , setResult ] = useState < string | undefined > ( )
32
37
const [ timeout , setTimeoutValue ] = useState < number > ( 5 )
33
38
34
39
const evaluate = useCallback ( ( ) => {
@@ -133,8 +138,12 @@ export const Component: React.FC = () => {
133
138
< CodeContent content = { result } />
134
139
</ div >
135
140
< DialogFooter >
136
- < Button onClick = { ( ) => setResult ( '' ) } > { t ( 'common.close' ) } </ Button >
141
+ < DialogClose asChild >
142
+ < Button variant = "default" > { t ( 'common.close' ) } </ Button >
143
+ </ DialogClose >
137
144
</ DialogFooter >
145
+
146
+ < BottomSafeArea />
138
147
</ DialogContent >
139
148
</ Dialog >
140
149
</ FixedFullscreenContainer >
0 commit comments