import clsx from "clsx" import type { JSX } from "react" import type { TableRowSelectionProps } from "./DataTable.types" export const TableRowSelection = ({ selectedCount, totalCount, onSelectAll, onClearSelection, actions = [], className, }: TableRowSelectionProps): JSX.Element | null => { if (selectedCount === 0) return null return (
{selectedCount} of {totalCount} row(s) selected. {onSelectAll && selectedCount < totalCount && ( )} {onClearSelection && ( )}
{actions.length > 0 && (
{actions.map(action => ( ))}
)}
) }