@@ -46,7 +46,6 @@ const SeatAllocationContent = ({
4646 const { getSeatAllocations, updateSeatAllocation, generateSeatAllocations } = useApiService ( ) ;
4747 const [ isCollapsed , setIsCollapsed ] = useState ( false ) ;
4848 const [ emptyChairCount , setEmptyChairCount ] = useState ( 0 ) ;
49- const [ danglingChairCount , setDanglingChairCount ] = useState ( 0 ) ;
5049 const [ constraintInputValues , setConstraintInputValues ] = useState ( {
5150 "last neighborhood" : 0 ,
5251 "Standort" : 0 ,
@@ -73,9 +72,8 @@ const SeatAllocationContent = ({
7372 useEffect ( ( ) => {
7473 ( async ( ) => {
7574 setLoading ( true ) ;
76- const { emptyChairsCount, danglingChairsCount } = updateChairLabels ( participants ) ;
75+ const emptyChairsCount = updateChairLabels ( participants ) ;
7776 setEmptyChairCount ( emptyChairsCount ) ;
78- setDanglingChairCount ( danglingChairsCount ) ;
7977 setLoading ( false ) ;
8078 } ) ( ) ;
8179
@@ -141,8 +139,7 @@ const SeatAllocationContent = ({
141139 }
142140 }
143141
144- let emptyChairsCount = 0 ;
145- let danglingChairsCount = 0 ;
142+ let emptyChairCount = 0 ;
146143 state . elements
147144 ?. forEach ( ( e : ElementProperties ) => {
148145 if ( e . type === "chair" && chairProfileMap . has ( e . id ) ) {
@@ -151,22 +148,18 @@ const SeatAllocationContent = ({
151148 ( e as Chair ) . belongsToVisitor = chairProfileMap . get ( e . id ) ! . isVisitor ;
152149 if ( ! ( e as Chair ) . attachedTo ) {
153150 toast . error ( "Some participants are assigned to chairs that are not linked to a table. It might cause inconsistencies. Please be aware." ) ;
154- danglingChairsCount ++ ;
155151 }
156152 } else if ( e . type === "chair" ) {
157153 ( e as Chair ) . assigneeProfileId = undefined ;
158154 ( e as Chair ) . assigneeName = undefined ;
159155 ( e as Chair ) . belongsToVisitor = undefined ;
160- emptyChairsCount ++ ;
161- if ( ! ( e as Chair ) . attachedTo ) {
162- danglingChairsCount ++ ;
163- }
156+ emptyChairCount ++ ;
164157 }
165158 } ) ;
166159
167160 setAllocated ( assigned ) ;
168161 setUnallocated ( unassigned ) ;
169- return { emptyChairsCount , danglingChairsCount } ;
162+ return emptyChairCount ;
170163 } ;
171164
172165 // Generate initial seat allocation: assign unallocated employees to empty chairs
@@ -326,12 +319,7 @@ const SeatAllocationContent = ({
326319 opacity : isCollapsed ? 0.3 : 1 ,
327320 } } >
328321 < Card className = "mb-6" style = { { display : isCollapsed ? "none" : "block" } } >
329- < div className = "flex flex-col" >
330- < b > { `Empty Chairs: ${ emptyChairCount } ` } </ b >
331- { danglingChairCount > 0 &&
332- < b > { "Warning: " + danglingChairCount + " chair(s) don't belong to a table." } </ b >
333- }
334- </ div >
322+ < b > { `Empty Seat Count: ${ emptyChairCount } ` } </ b >
335323 </ Card >
336324 < Card
337325 title = { `Unallocated Participants ( ${ unallocated . length } / ${ allocated . length + unallocated . length } )` }
0 commit comments