Files
tom goriunovandGitHub 2747e02d3a Show Celestia Blobs on Arbitrum chains (#2562)
* DA info

* ENV variable

* celestia batch page

* tests

* fix ts

* [skip ci] fixes
2025-02-11 09:42:33 +01:00

37 lines
979 B
TypeScript

import type { NextPage } from 'next';
import dynamic from 'next/dynamic';
import React from 'react';
import type { Props } from 'nextjs/getServerSideProps';
import PageNextJs from 'nextjs/PageNextJs';
import config from 'configs/app';
const rollupFeature = config.features.rollup;
const Batch = dynamic(() => {
if (!rollupFeature.isEnabled) {
throw new Error('Rollup feature is not enabled.');
}
switch (rollupFeature.type) {
case 'arbitrum':
return import('ui/pages/ArbitrumL2TxnBatch');
case 'optimistic':
return import('ui/pages/OptimisticL2TxnBatch');
}
throw new Error('Celestia txn batches feature is not enabled.');
}, { ssr: false });
const Page: NextPage<Props> = (props: Props) => {
return (
<PageNextJs pathname="/batches/celestia/[height]/[commitment]" query={ props.query }>
<Batch/>
</PageNextJs>
);
};
export default Page;
export { batchCelestia as getServerSideProps } from 'nextjs/getServerSideProps';