/** Import SecureFolder SDK */
import { SecureFolderSDK } from '@dataverse/secure-folder-sdk';
import { CurationModuleSDK } from '@dataverse/curation-module-sdk';
import { Button } from '@/index';

export default {
  title: 'withDataverseSDK-components',
  args: {
    curationId:
      '0x25fb12aec7517419e64a32446affe97f0165348070299c4069c39e7fa4389d79',
  },
};

export const GetCurationInfo: React.FC<{ curationId: string }> = ({
  curationId,
}) => {
  /**
   * Initialize the SDK class object:
   */
  const service = new CurationModuleSDK();
  const connect = async () => {
    try {
      const connectRes = await service.getCurationInfo(
        {
          getEthereum: () => window.ethereum,
          curationId,
        },
        true,
      );
      console.log(connectRes);
    } catch (e) {
      console.log(e);
    }
  };

  return (
    <Button
      onClick={() => {
        connect();
      }}
      label={'getCurationInfo'}
    />
  );
};
