1- import React , { useState } from "react" ;
2- import { Typography , Button } from "@mui/material" ;
1+ import React from "react" ;
2+ import { Typography } from "@mui/material" ;
33import { VBox , HBox } from "@/ui/shared-components/LayoutBoxes" ;
44import theme from "@/theme" ;
5- import MoreVertIcon from "@mui/icons-material/MoreVert" ;
65import RegularButton from "@/ui/shared-components/RegularButton" ;
76import { IconButton } from "@mui/material" ;
7+ import DeleteIcon from '@mui/icons-material/Delete' ;
8+ import FileDownloadIcon from '@mui/icons-material/FileDownload' ;
89
910
1011const UserItem = ( { t, user, continueWithExisting, deleteExistingProfile, exportProfile } ) => {
11- const [ isVisible , setIsVisible ] = useState ( false ) ;
12-
1312 return (
1413 < HBox sx = { {
1514 maxWidth : '800px' ,
@@ -23,13 +22,7 @@ const UserItem = ({ t, user, continueWithExisting, deleteExistingProfile, export
2322 < Typography variant = "h6" > { user . id } </ Typography >
2423 < Typography variant = "body2" > { user . type } </ Typography >
2524 </ VBox >
26- < HBox alignItems = { 'center' } justifyContent = { 'flex-end' } >
27- < RegularButton
28- variant = { 'yellowContained' }
29- onClick = { ( ) => continueWithExisting ( user . id ) }
30- text = { 'app.welcomeBack.continueBtn' }
31- link = { '/onboarding-choice' }
32- />
25+ < HBox alignItems = { 'center' } justifyContent = { 'flex-end' } sx = { { flexWrap : 'wrap' } } >
3326 < IconButton
3427 aria-label = "more options"
3528 sx = { {
@@ -40,57 +33,32 @@ const UserItem = ({ t, user, continueWithExisting, deleteExistingProfile, export
4033 color : 'black.main' ,
4134 } ,
4235 } }
43- onClick = { ( ) => setIsVisible ( ! isVisible ) }
36+ onClick = { ( ) => exportProfile ( user . id ) }
4437 >
45- < MoreVertIcon />
38+ < FileDownloadIcon sx = { { fontSize : '20px' } } />
4639 </ IconButton >
40+ < IconButton
41+ aria-label = "more options"
42+ sx = { {
43+ padding : '8px' ,
44+ color : 'blue.main' ,
45+ '&:hover' : {
46+ backgroundColor : 'transparent' ,
47+ color : 'black.main' ,
48+ } ,
49+ } }
50+ onClick = { ( ) => deleteExistingProfile ( user . id ) }
51+ >
52+ < DeleteIcon sx = { { fontSize : '20px' } } />
53+ </ IconButton >
54+ < RegularButton
55+ variant = { 'yellowContained' }
56+ onClick = { ( ) => continueWithExisting ( user . id ) }
57+ text = { 'app.welcomeBack.continueBtn' }
58+ link = { '/onboarding-choice' }
59+ />
4760 </ HBox >
4861 </ HBox >
49- {
50- isVisible && (
51- < HBox alignItems = { 'center' } justifyContent = { 'flex-end' } >
52- < Button
53- variant = "text"
54- onClick = { ( ) => exportProfile ( user . id ) }
55- sx = { {
56- color : 'blue.main' ,
57- padding : '0' ,
58- '&:hover' : {
59- backgroundColor : 'transparent' ,
60- color : 'black.main' ,
61- } ,
62- '&:focus' : {
63- backgroundColor : 'transparent' ,
64- color : 'black.main' ,
65- }
66- } }
67- >
68- < Typography variant = "body2" sx = { { color : 'inherit' } } >
69- { t ( "app.welcomeBack.exportBtn" ) }
70- </ Typography >
71- </ Button >
72- < Button
73- variant = "text"
74- onClick = { ( ) => deleteExistingProfile ( user . id ) }
75- sx = { {
76- padding : '0' ,
77- color : 'blue.main' ,
78- '&:hover' : {
79- backgroundColor : 'transparent' ,
80- color : 'black.main' ,
81- } ,
82- '&:focus' : {
83- backgroundColor : 'transparent' ,
84- color : 'black.main' ,
85- }
86- } } >
87- < Typography variant = "body2" sx = { { color : 'inherit' } } >
88- { t ( "app.welcomeBack.deleteBtn" ) }
89- </ Typography >
90- </ Button >
91- </ HBox >
92- )
93- }
9462 </ VBox >
9563 </ HBox >
9664 ) ;
0 commit comments