Download mui-datatables/src/components/ExpandButton.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/mui-datatables/src/components/ExpandButton.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/mui-datatables/src/components/ExpandButton.js
-
curl -L -o ExpandButton.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/mui-datatables/src/components/ExpandButton.js
1.12 kB
| import React from 'react'; | |
| import IconButton from '@mui/material/IconButton'; | |
| import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight'; | |
| import RemoveIcon from '@mui/icons-material/Remove'; | |
| const ExpandButton = ({ | |
| areAllRowsExpanded, | |
| buttonClass, | |
| expandableRowsHeader, | |
| expandedRows, | |
| iconClass, | |
| iconIndeterminateClass, | |
| isHeaderCell, | |
| onExpand, | |
| }) => { | |
| return ( | |
| <> | |
| {isHeaderCell && !areAllRowsExpanded() && areAllRowsExpanded && expandedRows.data.length > 0 ? ( | |
| <IconButton | |
| onClick={onExpand} | |
| style={{ padding: 0 }} | |
| disabled={expandableRowsHeader === false} | |
| className={buttonClass}> | |
| <RemoveIcon id="expandable-button" className={iconIndeterminateClass} /> | |
| </IconButton> | |
| ) : ( | |
| <IconButton | |
| onClick={onExpand} | |
| style={{ padding: 0 }} | |
| disabled={expandableRowsHeader === false} | |
| className={buttonClass}> | |
| <KeyboardArrowRightIcon id="expandable-button" className={iconClass} /> | |
| </IconButton> | |
| )} | |
| </> | |
| ); | |
| }; | |
| export default ExpandButton; | |