@@ -3,6 +3,8 @@ import type { NextPage, GetStaticProps } from 'next'
3
3
import React from 'react'
4
4
import Layout from '../components/layout'
5
5
6
+ import Image from 'next/image'
7
+
6
8
import MoreHorizIcon from '@mui/icons-material/MoreHoriz' ;
7
9
import EditIcon from '@mui/icons-material/Edit' ;
8
10
@@ -96,8 +98,8 @@ const Gui: NextPage<{ items: Array<string> }> = ({ items: itemsList }) => {
96
98
const item = guiData [ guiIndex ] . data [ id . pos ] ;
97
99
98
100
setId ( item ?. id ) ;
99
- setCount ( item ?. count ) ;
100
- setAction ( item ?. action . type ) ;
101
+ setCount ( item ?. count || 1 ) ;
102
+ setAction ( item ?. action . type || 'nothing' ) ;
101
103
if ( item ?. action . type == 'page' ) setGoToPage ( item ?. action . page ) ;
102
104
}
103
105
@@ -183,9 +185,9 @@ const Gui: NextPage<{ items: Array<string> }> = ({ items: itemsList }) => {
183
185
// outline: `1px solid ${(gui.data[i * 10 + j] && gui.data[i * 10 + j].action.type == 'page') ? 'red' : 'invisible'}`
184
186
} } >
185
187
{ gui . data [ i * 9 + j ] &&
186
- < Box sx = { { position : 'relative' } } >
188
+ < Box sx = { { position : 'relative' , width : '100%' , height : '100%' } } >
189
+ < Image src = { `/images/items/minecraft__${ gui . data [ i * 9 + j ] . id } .png` } layout = 'fill' />
187
190
< Typography sx = { { position : 'absolute' , bottom : 0 , right : 0 } } > { gui . data [ i * 9 + j ] . count } </ Typography >
188
- < img src = { `https://minecraftitemids.com/item/64/${ gui . data [ i * 9 + j ] . id } .png` } > </ img >
189
191
</ Box >
190
192
}
191
193
</ Box >
@@ -308,7 +310,16 @@ const Gui: NextPage<{ items: Array<string> }> = ({ items: itemsList }) => {
308
310
) }
309
311
/>
310
312
311
- < TextField variant = "standard" id = "outlined-number" label = "Count" type = "number" onChange = { handleChangeCount } value = { count } sx = { { mr : 1 } } />
313
+ < TextField variant = "standard" id = "outlined-number" label = "Count" type = "number"
314
+ onChange = { handleChangeCount }
315
+ defaultValue = { count }
316
+ sx = { { mr : 1 } }
317
+ InputProps = { {
318
+ inputProps : {
319
+ max : 64 , min : 1
320
+ }
321
+ } }
322
+ />
312
323
313
324
< TextField
314
325
variant = "standard"
@@ -405,7 +416,7 @@ const Gui: NextPage<{ items: Array<string> }> = ({ items: itemsList }) => {
405
416
renderOption = { ( props , option ) => < li { ...props } > { option . id } </ li > }
406
417
sx = { { width : 300 } }
407
418
freeSolo
408
- renderInput = { ( params ) => < TextField { ...params } variant = "standard" label = "Contener " /> }
419
+ renderInput = { ( params ) => < TextField { ...params } variant = "standard" label = "Gui type " /> }
409
420
/>
410
421
</ Box >
411
422
</ CardContent >
0 commit comments