{"size": 818, "ext": "js", "max_stars_repo_path": "src/renderer/component/rule/userscript/Tabs.js", "max_stars_repo_name": "simonpai/hammermonkey", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/renderer/component/rule/userscript/Tabs.js", "max_issues_repo_name": "simonpai/hammermonkey", "max_issues_repo_issues_event_min_datetime": "2018-11-06T14:15:58.000Z", "max_issues_repo_issues_event_max_datetime": "2019-02-25T14:28:30.000Z", "max_forks_repo_path": "src/renderer/component/rule/userscript/Tabs.js", "max_forks_repo_name": "simonpai/hammermonkey", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 7, "max_forks_count": null, "avg_line_length": 25.5625, "max_line_length": 87, "alphanum_fraction": 0.6222493888}
import React, { useCallback } from 'react';
import PropTypes from 'prop-types';
import { Tab } from 'semantic-ui-react';

import { useApi } from '../../../hook';
// import SettingsTab from './Settings';
import EditorTab from './Editor';

function UserscriptTabs({rule}) {
  const api = useApi();
  const {id} = rule;
  const onContentChange = useCallback(content => api.rule.update(id, {content}), [id]);
  return (
    <>
      <Tab.View.Tab value="editor" label="Editor" default>
        <EditorTab {...{rule, onContentChange}} />
      </Tab.View.Tab>
      {/*
      <Tab.View.Tab value="settings" label="Settings">
        <SettingsTab {...{rule, onNameChange}} />
      </Tab.View.Tab>
      */}
    </>
  );
}

UserscriptTabs.propTypes = {
  rule: PropTypes.object.isRequired
};

export default UserscriptTabs;
