diff --git a/striker-ui/components/List.tsx b/striker-ui/components/List.tsx index 364146ed..d2db75f2 100644 --- a/striker-ui/components/List.tsx +++ b/striker-ui/components/List.tsx @@ -140,36 +140,36 @@ const List = forwardRef( isEdit, onAllCheckboxChange, ]); - const headerElement = useMemo( - () => - isInsertHeader && header ? ( - - {checkAllElement} - {typeof header === 'string' ? ( - <> - {header} - - - ) : ( - header - )} - {deleteItemButton} - {editItemButton} - {addItemButton} - - ) : ( - header - ), - [ - addItemButton, - checkAllElement, - deleteItemButton, - editItemButton, - header, - headerSpacing, - isInsertHeader, - ], - ); + const headerElement = useMemo(() => { + const headerType = typeof header; + + return isInsertHeader && header ? ( + + {checkAllElement} + {['boolean', 'string'].includes(headerType) ? ( + <> + {headerType === 'string' && {header}} + + + ) : ( + header + )} + {deleteItemButton} + {editItemButton} + {addItemButton} + + ) : ( + header + ); + }, [ + addItemButton, + checkAllElement, + deleteItemButton, + editItemButton, + header, + headerSpacing, + isInsertHeader, + ]); const listEmptyElement = useMemo( () => typeof listEmpty === 'string' ? (