1414 * limitations under the License.
1515 */
1616import { Fragment } from 'react' ;
17- import {
18- Typography ,
19- Button ,
20- Paper ,
21- List ,
22- ListItem ,
23- ListItemText ,
24- ListItemSecondaryAction ,
25- IconButton ,
26- Divider ,
27- Avatar ,
28- } from '@material-ui/core' ;
29- import PersonIcon from '@material-ui/icons/Person' ;
30- import DeleteIcon from '@material-ui/icons/Delete' ;
31- import { useParticipantsStyles } from './Styles' ;
32- import { Entity } from '@backstage/catalog-model' ;
17+ import { Text , Button } from '@backstage/ui' ;
18+ import { RiDeleteBin6Line } from '@remixicon/react' ;
19+ import classes from './Participants.module.css' ;
3320
3421interface Participant {
3522 id : string ;
@@ -45,17 +32,12 @@ interface ParticipantsListProps {
4532 isProcessing : boolean ;
4633}
4734
48- export const ParticipantsList = (
49- {
50- participants,
51- onRemoveParticipant,
52- onClearAll,
53- isProcessing,
54- } : ParticipantsListProps ,
55- entity : Entity ,
56- ) => {
57- const classes = useParticipantsStyles ( ) ;
58-
35+ export const ParticipantsList = ( {
36+ participants,
37+ onRemoveParticipant,
38+ onClearAll,
39+ isProcessing,
40+ } : ParticipantsListProps ) => {
5941 const getParticipantClassName = ( participant : Participant ) => {
6042 return participant . fromGroup
6143 ? classes . groupMemberItem
@@ -69,60 +51,50 @@ export const ParticipantsList = (
6951 return (
7052 < div className = { classes . selectedParticipantsContainer } >
7153 < div className = { classes . participantsHeader } >
72- < Typography variant = "subtitle1" >
73- Selected Participants ({ participants . length } )
74- </ Typography >
54+ < Text weight = "bold" > Selected Participants ({ participants . length } )</ Text >
7555
76- < Button
77- variant = "outlined"
78- color = "secondary"
79- size = "small"
80- onClick = { onClearAll }
81- disabled = { isProcessing }
82- startIcon = { < DeleteIcon /> }
83- >
56+ < Button onClick = { onClearAll } isDisabled = { isProcessing } >
8457 Clear All
8558 </ Button >
8659 </ div >
8760
88- < Paper className = { classes . selectedParticipantsList } >
89- < List dense >
61+ < div className = { classes . selectedParticipantsList } >
62+ < ul style = { { listStyle : 'none' , padding : 0 , margin : 0 } } >
9063 { participants . map ( participant => (
9164 < Fragment key = { participant . id } >
92- < ListItem className = { getParticipantClassName ( participant ) } >
93- < Avatar
94- className = {
95- entity . kind === 'Group'
96- ? classes . groupAvatar
97- : classes . userAvatar
98- }
65+ < li
66+ className = { getParticipantClassName ( participant ) }
67+ style = { {
68+ display : 'flex' ,
69+ alignItems : 'center' ,
70+ padding : '12px 16px' ,
71+ borderBottom : '1px solid var(--bui-border)' ,
72+ } }
73+ >
74+ < div style = { { flex : 1 } } >
75+ < Text > { participant . displayName || participant . name } </ Text >
76+ { participant . fromGroup && (
77+ < Text
78+ variant = "body-small"
79+ className = { classes . groupInfoText }
80+ >
81+ From group: { participant . fromGroup }
82+ </ Text >
83+ ) }
84+ </ div >
85+ < Button
86+ variant = "secondary"
87+ aria-label = "Remove participant"
88+ onClick = { ( ) => onRemoveParticipant ( participant . id ) }
89+ isDisabled = { isProcessing }
9990 >
100- < PersonIcon />
101- </ Avatar >
102- < ListItemText
103- primary = { participant . displayName || participant . name }
104- secondary = {
105- participant . fromGroup
106- ? `From group: ${ participant . fromGroup } `
107- : undefined
108- }
109- />
110- < ListItemSecondaryAction >
111- < IconButton
112- edge = "end"
113- aria-label = "delete"
114- onClick = { ( ) => onRemoveParticipant ( participant . id ) }
115- disabled = { isProcessing }
116- >
117- < DeleteIcon fontSize = "small" />
118- </ IconButton >
119- </ ListItemSecondaryAction >
120- </ ListItem >
121- < Divider component = "li" />
91+ < RiDeleteBin6Line size = { 18 } />
92+ </ Button >
93+ </ li >
12294 </ Fragment >
12395 ) ) }
124- </ List >
125- </ Paper >
96+ </ ul >
97+ </ div >
12698 </ div >
12799 ) ;
128100} ;
0 commit comments