@0xsplits/splits-kit
Version:
UI Components for working with 0xSplits contracts
15 lines • 1.96 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import CreateSplitForm from '../CreateSplit/CreateSplitForm';
import { ADDRESS_ZERO } from '../../constants/addresses';
import ComponentLayout from '../util/ComponentLayout';
import ChainLogo from '../util/ChainLogo';
import { CHAIN_INFO, isSupportedChainId, } from '../../constants/chains';
import { DEFAULT_DISTRIBUTOR_FEE, DEFAULT_DISTRIBUTOR_FEE_OPTIONS, } from '../../constants/splits';
var CreateSplit = function (_a) {
var chainId = _a.chainId, _b = _a.type, type = _b === void 0 ? 'v2Push' : _b, salt = _a.salt, _c = _a.defaultDistributorFee, defaultDistributorFee = _c === void 0 ? DEFAULT_DISTRIBUTOR_FEE : _c, _d = _a.defaultOwner, defaultOwner = _d === void 0 ? ADDRESS_ZERO : _d, _e = _a.defaultRecipients, defaultRecipients = _e === void 0 ? [] : _e, _f = _a.defaultDistributorFeeOptions, defaultDistributorFeeOptions = _f === void 0 ? DEFAULT_DISTRIBUTOR_FEE_OPTIONS : _f, _g = _a.linkToApp, linkToApp = _g === void 0 ? true : _g, _h = _a.supportsEns, supportsEns = _h === void 0 ? true : _h, _j = _a.width, width = _j === void 0 ? 'lg' : _j, _k = _a.theme, theme = _k === void 0 ? 'system' : _k, _l = _a.displayChain, displayChain = _l === void 0 ? true : _l, onSuccess = _a.onSuccess, onError = _a.onError;
return (_jsx(ComponentLayout, { chainId: chainId, width: width, theme: theme, title: 'New Split contract', corner: displayChain && isSupportedChainId(chainId)
? CHAIN_INFO[chainId] && _jsx(ChainLogo, { chainInfo: CHAIN_INFO[chainId] })
: undefined, body: _jsx(CreateSplitForm, { defaultDistributorFee: defaultDistributorFee, defaultOwner: defaultOwner, defaultRecipients: defaultRecipients, defaultDistributorFeeOptions: defaultDistributorFeeOptions, chainId: chainId, type: type, salt: salt, linkToApp: linkToApp, supportsEns: supportsEns, onSuccess: onSuccess, onError: onError }) }));
};
export default CreateSplit;
//# sourceMappingURL=index.js.map