{"size": 829, "ext": "js", "max_stars_repo_path": "pages/admin/create-lock/index.js", "max_stars_repo_name": "desterds/gamesvault", "max_stars_repo_stars_event_min_datetime": "2021-07-30T15:06:41.000Z", "max_stars_repo_stars_event_max_datetime": "2021-07-30T15:06:41.000Z", "max_issues_repo_path": "pages/admin/create-lock/index.js", "max_issues_repo_name": "desterds/gamesvault", "max_issues_repo_issues_event_min_datetime": "2021-08-02T20:05:51.000Z", "max_issues_repo_issues_event_max_datetime": "2021-08-02T20:06:01.000Z", "max_forks_repo_path": "pages/admin/create-lock/index.js", "max_forks_repo_name": "desterds/gamesvault", "max_forks_repo_forks_event_min_datetime": "2021-08-20T22:54:01.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-20T22:54:01.000Z"}
{"max_stars_count": 1, "max_issues_count": 1, "max_forks_count": 1, "avg_line_length": 25.1212121212, "max_line_length": 71, "alphanum_fraction": 0.6537997587}
// import PropTypes from 'prop-types';
import { useEthers } from '@usedapp/core';
import { useState } from 'react';
import { toast } from 'react-toastify';

import { Page } from 'components/layouts';

import LockCreateForm from 'containers/lock-create-form';

import styles from './style.module.css';

function CreateLock() {
  const { account } = useEthers();
  const [purchases, setPurchases] = useState([]);
  const handleSuccess = (data) => {
    toast.success('purchased');
    setPurchases([data, ...purchases]);
  };

  return (
    <Page className={styles.page}>
      <div className={`${styles['purchase-lock-wrapper']} wrapper`}>
        <h1>Create Lock</h1>
        {account ? <LockCreateForm onSuccess={handleSuccess} /> : null}
      </div>
    </Page>
  );
}

CreateLock.propTypes = {};

export default CreateLock;
