|
| 1 | +/* |
| 2 | + * Copyright (c) 2024. Devtron Inc. |
| 3 | + */ |
| 4 | + |
| 5 | +import { ReactComponent as ICClose } from '@Icons/ic-close.svg' |
| 6 | +import { DraggableButton, DraggablePositionVariant, DraggableWrapper } from '@Common/DraggableWrapper' |
| 7 | +import { ComponentSizeType } from '@Shared/constants' |
| 8 | +import { BulkSelectionActionWidgetProps } from './types' |
| 9 | +import { Button, ButtonComponentType, ButtonStyleType, ButtonVariantType } from '../Button' |
| 10 | + |
| 11 | +const BulkSelectionActionWidget = ({ |
| 12 | + count, |
| 13 | + handleClearBulkSelection, |
| 14 | + parentRef, |
| 15 | + BulkActionsComponent, |
| 16 | +}: BulkSelectionActionWidgetProps) => ( |
| 17 | + <DraggableWrapper |
| 18 | + dragSelector=".drag-selector" |
| 19 | + positionVariant={DraggablePositionVariant.PARENT_BOTTOM_CENTER} |
| 20 | + zIndex="calc(var(--modal-index) - 1)" |
| 21 | + parentRef={parentRef} |
| 22 | + > |
| 23 | + <div className="dc__separated-flexbox dc__separated-flexbox--gap-8 pt-12 pb-12 pr-12 pl-12 bulk-selection-widget br-8"> |
| 24 | + <div className="flexbox dc__gap-8"> |
| 25 | + <DraggableButton dragClassName="drag-selector" /> |
| 26 | + |
| 27 | + <div className="fs-13 lh-20 fw-6 flex dc__gap-12"> |
| 28 | + <span className="flex dc__gap-2 bcb-5 cn-0 br-4 pr-6 pl-6">{count}</span> |
| 29 | + <span className="cn-9">Selected</span> |
| 30 | + </div> |
| 31 | + </div> |
| 32 | + |
| 33 | + <BulkActionsComponent /> |
| 34 | + |
| 35 | + <Button |
| 36 | + icon={<ICClose />} |
| 37 | + dataTestId="table__action-widget--close" |
| 38 | + component={ButtonComponentType.button} |
| 39 | + style={ButtonStyleType.negativeGrey} |
| 40 | + variant={ButtonVariantType.borderLess} |
| 41 | + ariaLabel="Clear selection(s)" |
| 42 | + size={ComponentSizeType.small} |
| 43 | + onClick={handleClearBulkSelection} |
| 44 | + showAriaLabelInTippy |
| 45 | + /> |
| 46 | + </div> |
| 47 | + </DraggableWrapper> |
| 48 | +) |
| 49 | + |
| 50 | +export default BulkSelectionActionWidget |
0 commit comments