Files
pezkuwi-apps/packages/page-referenda/src/Referenda/RefEnd.tsx
T
pezkuwichain d21bfb1320 feat: initial Pezkuwi Apps rebrand from polkadot-apps
Rebranded terminology:
- Polkadot → Pezkuwi
- Kusama → Dicle
- Westend → Zagros
- Rococo → PezkuwiChain
- Substrate → Bizinikiwi
- parachain → teyrchain

Custom logos with Kurdistan brand colors (#e6007a → #86e62a):
- bizinikiwi-hexagon.svg
- sora-bizinikiwi.svg
- hezscanner.svg
- heztreasury.svg
- pezkuwiscan.svg
- pezkuwistats.svg
- pezkuwiassembly.svg
- pezkuwiholic.svg
2026-01-07 13:05:27 +03:00

42 lines
1.1 KiB
TypeScript

// Copyright 2017-2025 @pezkuwi/app-referenda authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { BN } from '@pezkuwi/util';
import React from 'react';
import { useBestNumberRelay, useStakingAsyncApis } from '@pezkuwi/react-hooks';
import { BlockToTime } from '@pezkuwi/react-query';
import { formatNumber } from '@pezkuwi/util';
interface Props {
className?: string;
label: string;
when: BN | null;
}
function RefEnd ({ className = '', label, when }: Props): React.ReactElement<Props> {
const bestNumber = useBestNumberRelay();
const { isStakingAsync, rcApi } = useStakingAsyncApis();
return (
<td className={`${className} number`}>
{bestNumber && when && (
<>
<div>{label}</div>
{/* Remaining period should be decided based on Relay chain */}
{when.gt(bestNumber) && (
<BlockToTime
api={isStakingAsync ? rcApi : undefined}
value={when.sub(bestNumber)}
/>
)}
<div>#{formatNumber(when)}</div>
</>
)}
</td>
);
}
export default React.memo(RefEnd);