import PropTypes from 'prop-types';
import { isEmpty } from 'lodash';
import { Typography } from '@mui/material';
import TipsActivity from './tips';

/**
 * 根据 activity 的类型 渲染 activity 的 meta 信息
 */
import { jsx as _jsx } from "react/jsx-runtime";
Meta.propTypes = {
  meta: PropTypes.object.isRequired,
  type: PropTypes.string.isRequired,
  hideTips: PropTypes.bool,
  sx: PropTypes.object
};
export default function Meta({
  meta,
  type,
  hideTips = false,
  sx = {}
}) {
  if (isEmpty(meta)) {
    return null;
  }
  if (type === 'tips' && !hideTips) {
    return /*#__PURE__*/_jsx(TipsActivity, {
      meta: meta
    });
  }
  return /*#__PURE__*/_jsx(Typography, {
    variant: "subtitle2",
    component: "p",
    sx: [{
      fontSize: 16,
      color: 'text.secondary',
      wordBreak: 'break-all'
    }, ...(Array.isArray(sx) ? sx : [sx])],
    children: meta.content
  });
}