mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Improve code style
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
parent
81d5c7a8e6
commit
4c1489c3d5
@ -17,13 +17,10 @@ interface ItemListLayoutHeaderInfoProps<I extends ItemObject> {
|
||||
}
|
||||
|
||||
export const ItemListLayoutHeaderInfo = observer(
|
||||
<I extends ItemObject>({
|
||||
headerPlaceholders,
|
||||
getItems,
|
||||
getFilters,
|
||||
store,
|
||||
toggleFilters,
|
||||
}: ItemListLayoutHeaderInfoProps<I>) => {
|
||||
<I extends ItemObject>(props: ItemListLayoutHeaderInfoProps<I>) => {
|
||||
const { headerPlaceholders, getItems, getFilters, store, toggleFilters } =
|
||||
props;
|
||||
|
||||
const renderInfo = () => {
|
||||
const allItemsCount = store.getTotalCount();
|
||||
const itemsCount = getItems().length;
|
||||
@ -42,9 +39,10 @@ export const ItemListLayoutHeaderInfo = observer(
|
||||
: `${allItemsCount} items`;
|
||||
};
|
||||
|
||||
const info = headerPlaceholders.info === undefined
|
||||
? renderInfo()
|
||||
: headerPlaceholders.info;
|
||||
const info =
|
||||
headerPlaceholders.info === undefined
|
||||
? renderInfo()
|
||||
: headerPlaceholders.info;
|
||||
|
||||
if (!info) {
|
||||
return null;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user