import { LocaleContext } from '@arcblock/ux/lib/Locale/context';
import Tabs from '@arcblock/ux/lib/Tabs';
import { Box } from '@mui/material';
import { useCreation } from 'ahooks';
import { useContext, useMemo, useState } from 'react';
import NotificationEmail from './email';
import NotificationPushKit from './push-kit';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
const tabs = [{
  label: /*#__PURE__*/_jsx(Box, {
    sx: {
      textAlign: 'center',
      width: '100%'
    },
    children: "Email"
  }),
  value: 'email'
}, {
  label: /*#__PURE__*/_jsx(Box, {
    sx: {
      textAlign: 'center',
      width: '100%'
    },
    children: "Push Kit"
  }),
  value: 'pushKit'
}];
function BlockletNotification() {
  const [currentTab, setCurrentTab] = useState(tabs[0].value);
  const {
    locale
  } = useContext(LocaleContext);
  const contents = useCreation(() => ({
    email: /*#__PURE__*/_jsx(NotificationEmail, {}),
    pushKit: /*#__PURE__*/_jsx(NotificationPushKit, {})
  }), [locale]);
  const tabBodyStyle = useMemo(() => {
    return {
      padding: '10px 0'
    };
  }, []);
  return /*#__PURE__*/_jsxs(Box, {
    children: [/*#__PURE__*/_jsx(Tabs, {
      tabs: tabs,
      current: currentTab,
      onChange: setCurrentTab
    }), /*#__PURE__*/_jsx(Box, {
      style: tabBodyStyle,
      children: contents[currentTab]
    })]
  });
}
export default BlockletNotification;