import { __rest } from "tslib";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { styled } from '@mui/material/styles';
import { Box, Typography } from '@mui/material';
import classNames from 'classnames';
import Widget from '../../components/Widget';
import { useThemeProps } from '@mui/system';
const PREFIX = 'SCBaseItem';
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 = styled(Widget, {
    name: PREFIX,
    slot: 'Root',
    overridesResolver: (props, styles) => styles.root
})(({ theme }) => ({}));
/**
 * > API documentation for the Community-JS BaseItem component. Learn about the available props and the CSS API.

 #### Import

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

 #### Component Name

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


 #### CSS

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

 * @param inProps
 */
export default function BaseItem(inProps) {
    // PROPS
    const props = useThemeProps({
        props: inProps,
        name: PREFIX
    });
    const { id = null, className = null, image = null, disableTypography = false, primary = null, primaryTypographyProps = { component: 'span', variant: 'body1' }, secondary = null, secondaryTypographyProps = { component: 'p', variant: 'body2' }, actions = null } = props, rest = __rest(props, ["id", "className", "image", "disableTypography", "primary", "primaryTypographyProps", "secondary", "secondaryTypographyProps", "actions"]);
    // RENDER
    return (_jsxs(Root, Object.assign({ id: id }, rest, { className: classNames(classes.root, className, { [classes.withActions]: Boolean(actions) }) }, { children: [_jsxs(Box, Object.assign({ className: classes.content }, { children: [image && _jsx(Box, Object.assign({ className: classes.image }, { children: image })), _jsxs(Box, Object.assign({ className: classes.text }, { children: [primary &&
                                (disableTypography ? (primary) : (_jsx(Typography, Object.assign({ className: classes.primary }, primaryTypographyProps, { children: primary })))), secondary &&
                                (disableTypography ? (secondary) : (_jsx(Typography, Object.assign({ className: classes.secondary }, secondaryTypographyProps, { children: secondary }))))] }))] })), actions && _jsx(Box, Object.assign({ className: classes.actions }, { children: actions }))] })));
}
