Skip to content

Commit

Permalink
Improve code style
Browse files Browse the repository at this point in the history
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
  • Loading branch information
jansav committed Jan 21, 2022
1 parent a821e16 commit 0b630a8
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 0b630a8

Please sign in to comment.