@@ -7,28 +7,33 @@ import CodeContent from '@/components/CodeContent'
77import CodeMirrorLoading from '@/components/CodeMirrorLoading'
88import FixedFullscreenContainer from '@/components/FixedFullscreenContainer'
99import PageTitle from '@/components/PageTitle'
10+ import { useResponsiveDialog } from '@/components/ResponsiveDialog'
1011import { Button } from '@/components/ui/button'
11- import {
12- Dialog ,
13- DialogContent ,
14- DialogFooter ,
15- DialogHeader ,
16- DialogTitle ,
17- } from '@/components/ui/dialog'
1812import { Input } from '@/components/ui/input'
1913import { Label } from '@/components/ui/label'
14+ import { BottomSafeArea } from '@/components/VerticalSafeArea'
2015import { EvaluateResult } from '@/types'
2116import fetcher from '@/utils/fetcher'
2217
2318const CodeMirror = lazy ( ( ) => import ( '@/components/CodeMirror' ) )
2419
2520export const Component : React . FC = ( ) => {
2621 const { t } = useTranslation ( )
22+
23+ const {
24+ Dialog,
25+ DialogContent,
26+ DialogHeader,
27+ DialogTitle,
28+ DialogFooter,
29+ DialogClose,
30+ } = useResponsiveDialog ( )
31+
2732 const [ code , setCode ] = useState < string > ( ( ) =>
2833 t ( 'scripting.editor_placeholder' ) ,
2934 )
3035 const [ isLoading , setIsLoading ] = useState ( false )
31- const [ result , setResult ] = useState < string > ( )
36+ const [ result , setResult ] = useState < string | undefined > ( )
3237 const [ timeout , setTimeoutValue ] = useState < number > ( 5 )
3338
3439 const evaluate = useCallback ( ( ) => {
@@ -133,8 +138,12 @@ export const Component: React.FC = () => {
133138 < CodeContent content = { result } />
134139 </ div >
135140 < DialogFooter >
136- < Button onClick = { ( ) => setResult ( '' ) } > { t ( 'common.close' ) } </ Button >
141+ < DialogClose asChild >
142+ < Button variant = "default" > { t ( 'common.close' ) } </ Button >
143+ </ DialogClose >
137144 </ DialogFooter >
145+
146+ < BottomSafeArea />
138147 </ DialogContent >
139148 </ Dialog >
140149 </ FixedFullscreenContainer >
0 commit comments