Skip to content

Commit 3c5eaa2

Browse files
committed
chore: switch to if component
1 parent 1282751 commit 3c5eaa2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

packages/pluggableWidgets/datagrid-web/src/components/WidgetFooter.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { If } from "@mendix/widget-plugin-component-kit/If";
12
import { observer } from "mobx-react-lite";
23
import { createElement, ReactElement, ReactNode } from "react";
34
import { PaginationEnum, PagingPositionEnum } from "../../typings/DatagridProps";
@@ -41,8 +42,10 @@ export function WidgetFooter(props: WidgetFooterProps): ReactElement | null {
4142

4243
const SelectionCounter = observer(function SelectionCounter() {
4344
const { selectionCountStore } = useDatagridRootScope();
44-
if (selectionCountStore.displayCount) {
45-
return <span className="widget-datagrid-selection-count">{selectionCountStore.displayCount}</span>;
46-
}
47-
return null;
45+
46+
return (
47+
<If condition={selectionCountStore.displayCount !== ""}>
48+
<span className="widget-datagrid-selection-count">{selectionCountStore.displayCount}</span>
49+
</If>
50+
);
4851
});

0 commit comments

Comments
 (0)