11import React , { useState , useEffect } from "react" ;
22import { Button } from "primereact/button" ;
3+ import { useTranslation } from "@zxplay/i18n" ;
34
45// ZX Spectrum color palette
56const SPECTRUM_COLORS = [
@@ -21,6 +22,7 @@ const SPECTRUM_COLORS = [
2122] ;
2223
2324export default function AvatarPixelEditor ( { identifier, onSave, onCancel, customAvatarData } ) {
25+ const { t } = useTranslation ( ) ;
2426 const [ grid , setGrid ] = useState ( ( ) => {
2527 // Initialize empty 8x8 grid
2628 return Array ( 8 )
@@ -151,7 +153,7 @@ export default function AvatarPixelEditor({ identifier, onSave, onCancel, custom
151153 { /* Left side - Drawing canvas */ }
152154 < div className = "flex-grow-1" >
153155 < div className = "mb-2" >
154- < h4 className = "m-1" > Draw Your Avatar </ h4 >
156+ < h4 className = "m-1" > { t ( "avatar.drawTitle" ) } </ h4 >
155157 </ div >
156158
157159 < div
@@ -197,25 +199,25 @@ export default function AvatarPixelEditor({ identifier, onSave, onCancel, custom
197199 { /* Tools */ }
198200 < div className = "mt-3 flex gap-2" >
199201 < Button
200- label = "Clear"
202+ label = { t ( "avatar.clear" ) }
201203 icon = "pi pi-trash"
202204 className = "p-button-sm p-button-outlined"
203205 onClick = { clearGrid }
204206 />
205207 < Button
206- label = "Fill"
208+ label = { t ( "avatar.fill" ) }
207209 icon = "pi pi-stop"
208210 className = "p-button-sm p-button-outlined"
209211 onClick = { fillGrid }
210212 />
211213 < Button
212- label = "Flip"
214+ label = { t ( "avatar.flip" ) }
213215 icon = "pi pi-arrows-h"
214216 className = "p-button-sm p-button-outlined"
215217 onClick = { flipHorizontal }
216218 />
217219 < Button
218- label = "Flip"
220+ label = { t ( "avatar.flip" ) }
219221 icon = "pi pi-arrows-v"
220222 className = "p-button-sm p-button-outlined"
221223 onClick = { flipVertical }
@@ -225,7 +227,7 @@ export default function AvatarPixelEditor({ identifier, onSave, onCancel, custom
225227
226228 { /* Right side - Color palette and preview */ }
227229 < div style = { { width : "200px" } } >
228- < h4 className = "m-0 mb-2" > Colors </ h4 >
230+ < h4 className = "m-0 mb-2" > { t ( "avatar.colors" ) } </ h4 >
229231
230232 { /* Tool selection */ }
231233 < div className = "flex gap-1 mb-2" >
@@ -278,7 +280,7 @@ export default function AvatarPixelEditor({ identifier, onSave, onCancel, custom
278280 </ div >
279281
280282 { /* Preview */ }
281- < h4 className = "mt-3 mb-2" > Preview </ h4 >
283+ < h4 className = "mt-3 mb-2" > { t ( "avatar.preview" ) } </ h4 >
282284 < div
283285 style = { {
284286 padding : "8px" ,
@@ -303,12 +305,12 @@ export default function AvatarPixelEditor({ identifier, onSave, onCancel, custom
303305 { /* Action buttons */ }
304306 < div className = "flex justify-content-end gap-2 mt-3" >
305307 < Button
306- label = "Cancel"
308+ label = { t ( "actions.cancel" ) }
307309 className = "p-button-text p-button-sm"
308310 onClick = { onCancel }
309311 />
310312 < Button
311- label = "Use This Avatar"
313+ label = { t ( "avatar.useThis" ) }
312314 icon = "pi pi-check"
313315 className = "p-button-sm"
314316 onClick = { handleSave }
0 commit comments