mirror of
https://github.com/getredash/redash.git
synced 2025-12-25 01:03:20 -05:00
* Prettier all the JS files * Add GitHub Action to autoformat code pushed to master * Fix eslint violation due to formatting. * Remove GitHub actions for styling * Add restyled.io config
32 lines
812 B
JavaScript
32 lines
812 B
JavaScript
import React from "react";
|
|
import PropTypes from "prop-types";
|
|
import Tooltip from "antd/lib/tooltip";
|
|
|
|
export default function ListItemAddon({ isSelected, isStaged, alreadyInGroup, deselectedIcon }) {
|
|
if (isStaged) {
|
|
return <i className="fa fa-remove" />;
|
|
}
|
|
if (alreadyInGroup) {
|
|
return (
|
|
<Tooltip title="Already selected">
|
|
<i className="fa fa-check" />
|
|
</Tooltip>
|
|
);
|
|
}
|
|
return isSelected ? <i className="fa fa-check" /> : <i className={`fa ${deselectedIcon}`} />;
|
|
}
|
|
|
|
ListItemAddon.propTypes = {
|
|
isSelected: PropTypes.bool,
|
|
isStaged: PropTypes.bool,
|
|
alreadyInGroup: PropTypes.bool,
|
|
deselectedIcon: PropTypes.string,
|
|
};
|
|
|
|
ListItemAddon.defaultProps = {
|
|
isSelected: false,
|
|
isStaged: false,
|
|
alreadyInGroup: false,
|
|
deselectedIcon: "fa-angle-double-right",
|
|
};
|