// Copyright 2017-2026 @pezkuwi/app-teyrchains authors & contributors // SPDX-License-Identifier: Apache-2.0 import '@pezkuwi/api-augment/bizinikiwi'; import type { ParaId } from '@pezkuwi/types/interfaces'; import React, { useRef } from 'react'; import { Route, Routes } from 'react-router'; import { useLocation } from 'react-router-dom'; import { Tabs } from '@pezkuwi/react-components'; import { useApi, useCall } from '@pezkuwi/react-hooks'; import Auctions from './Auctions/index.js'; import Crowdloan from './Crowdloan/index.js'; import Overview from './Overview/index.js'; import Parathreads from './Parathreads/index.js'; import Proposals from './Proposals/index.js'; import { useTranslation } from './translate.js'; import useActionsQueue from './useActionsQueue.js'; import useAuctionInfo from './useAuctionInfo.js'; import useFunds from './useFunds.js'; import useLeasePeriod from './useLeasePeriod.js'; import useOwnedIds from './useOwnedIds.js'; import useProposals from './useProposals.js'; import useUpcomingIds from './useUpcomingIds.js'; import useWinningData from './useWinningData.js'; interface Props { basePath: string; className?: string; } function TeyrchainsApp ({ basePath, className }: Props): React.ReactElement { const { t } = useTranslation(); const { api } = useApi(); const { pathname } = useLocation(); const auctionInfo = useAuctionInfo(); const campaigns = useFunds(); const leasePeriod = useLeasePeriod(); const ownedIds = useOwnedIds(); const winningData = useWinningData(auctionInfo); const proposals = useProposals(); const actionsQueue = useActionsQueue(); const upcomingIds = useUpcomingIds(); const paraIds = useCall(api.query.paras.teyrchains); const items = useRef([ { isRoot: true, name: 'overview', text: t('Overview') }, { name: 'parathreads', text: t('Parathreads') }, api.query.proposeTeyrchain && { name: 'proposals', text: t('Proposals') }, api.query.auctions && { name: 'auctions', text: t('Auctions') }, api.query.crowdloan && { name: 'crowdloan', text: t('Crowdloan') } ].filter((q) => !!q)); return (
} path='auctions' /> } path='crowdloan' /> } path='proposals' />
); } export default React.memo(TeyrchainsApp);