// Copyright 2017-2026 @pezkuwi/app-coretime authors & contributors // SPDX-License-Identifier: Apache-2.0 import type { RelayName, SaleParameters } from '../types.js'; import React, { useMemo } from 'react'; import { styled } from '@pezkuwi/react-components'; import { PhaseName } from '../constants.js'; import { useTranslation } from '../translate.js'; import PhaseTable from './PhaseTable.js'; import { SubscanModuleCallUrl } from './SubscanModuleCallUrl.js'; const ResponsiveContainer = styled.div` display: flex; flex-direction: row; justify-content: flex-start; gap: 10rem; margin-top: 2rem; @media (max-width: 1000px) { flex-direction: column; } `; const Title = styled.h3` font-weight: bold; margin-bottom: 1rem; `; const LinkWithLogo = ({ alt, href, logo }: { href: string, logo: string, alt: string }) => { return ( {alt} ); }; const providers = { lastic: { alt: 'Lastic', href: (chainName: string) => `https://www.lastic.xyz/${chainName}/bulkcore1`, logo: 'https://www.lastic.xyz/_next/image?url=%2Fassets%2FImages%2FLogos%2Flastic-logo.png&w=384&q=100' }, regionx: { alt: 'RegionX', href: (chainName: string) => `https://app.regionx.tech/?network=${chainName}`, logo: 'https://app.regionx.tech/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Flogo.8f0fd171.png&w=3840&q=75' }, subscan: { alt: 'Subscan', href: (chainName: string) => `https://coretime-${chainName}.subscan.io/coretime_dashboard`, logo: 'https://www.subscan.io/_next/image?url=%2Fwebsite%2Flogo-light.png&w=256&q=75' } }; const phases = { [PhaseName.Renewals]: { description: 'In this phase, core owners can renew existing cores at a fixed price to ensure continued operation in the next region. No new core purchases are permitted.', name: 'Interlude/Renewals phase' }, [PhaseName.PriceDiscovery]: { description: 'The period during which cores are available for both purchase and renewal. The price decreases linearly over time.', name: 'Price Discovery phase' }, [PhaseName.FixedPrice]: { description: 'The period during which cores are available for both purchase and renewal. The price remains fixed towards the end of the sales period.', name: 'Fixed price phase' } }; const dotLakeUrl = 'https://data.parity.io/coretime'; const SaleDetailsView = ({ chosenSaleNumber, relayName, saleParams }: { saleParams: SaleParameters, chosenSaleNumber: number, relayName: RelayName }) => { const { t } = useTranslation(); const subscanPriceGraphUrl = useMemo(() => `https://coretime-${relayName}.subscan.io/coretime_dashboard` , [relayName]); if (chosenSaleNumber === -1 || !saleParams) { return null; } return (
Sale phases
{!saleParams?.phaseConfig &&

{t(`This sale is of unusual length of ${saleParams.currentRegion.end.ts - saleParams.currentRegion.start.ts} timeslices, hence the regular phases are not applicable.`)}

{t(`Sale start timeslice: ${saleParams.currentRegion.start.ts}`)}

{t(`Sale end timeslice: ${saleParams.currentRegion.end.ts}`)}

} {saleParams?.phaseConfig && Object.entries(phases).map(([phase, { description, name }]) => (

{t(name)}

{t(description)}

{saleParams?.phaseConfig && }
))}
{t('Region for sale ')}

{t('Region is an asset of Coretime. It signifies the upcoming sales period within which a core can be secured by purchasing coretime. Acquiring coretime grants access to a core for the duration of that specific region.')}

{saleParams?.regionForSale && } {t('Subscan Links')}
Sale Purchase Graph
{t('DotLake Coretime Dashboard')} Dot Lake {t('Coretime providers')}
{Object.entries(providers).map(([provider, { alt, href, logo }]) => ( ))}
); }; export default SaleDetailsView;