hooks
4 years ago
images
4 years ago
BulkActionCheckbox.tsx
4 years ago
BulkActionSelect.module.scss
4 years ago
BulkActionSelect.tsx
4 years ago
Filters.tsx
4 years ago
FormSelect.module.scss
4 years ago
FormSelect.tsx
4 years ago
Input.module.scss
4 years ago
Input.tsx
4 years ago
ListTable.module.scss
4 years ago
ListTable.tsx
4 years ago
ListTablePage.module.scss
3 years ago
ListTableRows.module.scss
3 years ago
ListTableRows.tsx
4 years ago
Pagination.module.scss
4 years ago
Pagination.tsx
4 years ago
README.MD
4 years ago
RowAction.module.scss
4 years ago
RowAction.tsx
4 years ago
Select.module.scss
4 years ago
Select.tsx
4 years ago
TableCell.module.scss
4 years ago
TableCell.tsx
4 years ago
TestLabel.module.scss
4 years ago
TestLabel.tsx
4 years ago
TypeBadge.module.scss
4 years ago
TypeBadge.tsx
4 years ago
api.ts
4 years ago
index.tsx
4 years ago
RowAction.tsx
41 lines
| 1 | import styles from './RowAction.module.scss'; |
| 2 | import cx from 'classnames'; |
| 3 | |
| 4 | export default function RowAction({ |
| 5 | onClick = null, |
| 6 | className = '', |
| 7 | actionId = null, |
| 8 | displayText, |
| 9 | hiddenText = '', |
| 10 | disabled = false, |
| 11 | highlight = false, |
| 12 | href = '' |
| 13 | }) { |
| 14 | if(href) { |
| 15 | return ( |
| 16 | <a |
| 17 | href={href} |
| 18 | className={cx(styles.action, {[styles.delete]: highlight }, className)} |
| 19 | > |
| 20 | {displayText} {hiddenText && <span className="give-visually-hidden">{hiddenText}</span>} |
| 21 | </a> |
| 22 | ); |
| 23 | } |
| 24 | |
| 25 | if(!onClick) { |
| 26 | return null; |
| 27 | } |
| 28 | |
| 29 | return ( |
| 30 | <button |
| 31 | type="button" |
| 32 | onClick={onClick} |
| 33 | data-actionid={actionId} |
| 34 | className={cx(styles.action, {[styles.delete]: highlight }, className)} |
| 35 | disabled={disabled} |
| 36 | > |
| 37 | {displayText} {hiddenText && <span className="give-visually-hidden">{hiddenText}</span>} |
| 38 | </button> |
| 39 | ); |
| 40 | } |
| 41 |