@selfcommunity/react-ui
Version:
React UI Components to integrate a Community created with SelfCommunity Platform.
25 lines (24 loc) • 1.42 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const material_1 = require("@mui/material");
const react_intl_1 = require("react-intl");
const constants_1 = require("./constants");
const Events_1 = require("./Events");
function PastEventsFilter(inProps) {
// PROPS
const props = (0, material_1.useThemeProps)({
props: inProps,
name: constants_1.PREFIX
});
const { autoHide = false, showPastEvents, handleClick, handleDeleteClick } = props, rest = tslib_1.__rest(props, ["autoHide", "showPastEvents", "handleClick", "handleDeleteClick"]);
if (autoHide) {
return null;
}
return ((0, jsx_runtime_1.jsx)(Events_1.EventsChipRoot, Object.assign({ color: showPastEvents ? 'secondary' : 'default', variant: showPastEvents ? 'filled' : 'outlined', label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByPastEvents", defaultMessage: "ui.events.filterByPastEvents" }), onClick: handleClick,
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
showPastEvents: showPastEvents, deleteIcon: showPastEvents ? (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) : null, onDelete: showPastEvents ? handleDeleteClick : undefined }, rest)));
}
exports.default = PastEventsFilter;
;