"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const styles_1 = require("@mui/material/styles");
const material_1 = require("@mui/material");
const classnames_1 = tslib_1.__importDefault(require("classnames"));
const Widget_1 = tslib_1.__importDefault(require("../../components/Widget"));
const system_1 = require("@mui/system");
const PREFIX = 'SCBaseItemButton';
const classes = {
    root: `${PREFIX}-root`,
    withActions: `${PREFIX}-with-actions`,
    content: `${PREFIX}-content`,
    image: `${PREFIX}-image`,
    text: `${PREFIX}-text`,
    primary: `${PREFIX}-primary`,
    secondary: `${PREFIX}-secondary`,
    actions: `${PREFIX}-actions`
};
const Root = (0, styles_1.styled)(Widget_1.default, {
    name: PREFIX,
    slot: 'Root',
    overridesResolver: (props, styles) => styles.root
})(({ theme }) => ({}));
/**
 * > API documentation for the Community-JS BaseItemButton component. Learn about the available props and the CSS API.

 #### Import

 ```jsx
 import {BaseItemButton} from '@selfcommunity/react-ui';
 ```

 #### Component Name

 The name `BaseItemButton` can be used when providing style overrides in the theme.


 #### CSS

 |Rule Name|Global class|Description|
 |---|---|---|
 |root|.SCBaseItemButton-root|Styles applied to the root element.|
 |content|.SCBaseItemButton-content|Styles applied to the content element.|
 |image|.SCBaseItemButton-image|Styles applied to image section.|
 |text|.SCBaseItemButton-text|Styles applied to text section.|
 |primary|.SCBaseItemButton-primary|Styles applied to primary section.|
 |secondary|.SCBaseItemButton-secondary|Styles applied to secondary section.|
 |actions|.SCBaseItemButton-actions|Styles applied to actions section.|

 * @param inProps
 */
function BaseItemButton(inProps) {
    // PROPS
    const props = (0, system_1.useThemeProps)({
        props: inProps,
        name: PREFIX
    });
    const { id = null, className = null, ButtonBaseProps = {}, image = null, disableTypography = false, primary = null, primaryTypographyProps = { component: 'span', variant: 'body1' }, secondary = null, secondaryTypographyProps = { component: 'p', variant: 'body2' }, actions = null } = props, rest = tslib_1.__rest(props, ["id", "className", "ButtonBaseProps", "image", "disableTypography", "primary", "primaryTypographyProps", "secondary", "secondaryTypographyProps", "actions"]);
    // RENDER
    return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ id: id }, rest, { className: (0, classnames_1.default)(classes.root, className, { [classes.withActions]: Boolean(actions) }) }, { children: [(0, jsx_runtime_1.jsxs)(material_1.ButtonBase, Object.assign({ className: classes.content }, ButtonBaseProps, { children: [image && (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.image }, { children: image })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.text }, { children: [primary &&
                                (disableTypography ? (primary) : ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.primary }, primaryTypographyProps, { children: primary })))), secondary &&
                                (disableTypography ? (secondary) : ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.secondary }, secondaryTypographyProps, { children: secondary }))))] }))] })), actions && (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.actions }, { children: actions }))] })));
}
exports.default = BaseItemButton;
