mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-07-01 02:27:21 +00:00
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
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
// Copyright 2017-2025 @pezkuwi/app-coretime authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ChainInformation, ChainWorkTaskInformation } from '@pezkuwi/react-hooks/types';
|
||||
import type { RelayName } from './types.js';
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { ExpandButton } from '@pezkuwi/react-components';
|
||||
import { useToggle } from '@pezkuwi/react-hooks';
|
||||
|
||||
import Row from './Row.js';
|
||||
|
||||
interface Props {
|
||||
chain: ChainInformation
|
||||
regionEnd: number
|
||||
regionBegin: number
|
||||
lastCommittedTimeslice: number
|
||||
relayName: RelayName
|
||||
}
|
||||
|
||||
function TeyrchainTableRow ({ chain, lastCommittedTimeslice, regionBegin, regionEnd, relayName }: Props): React.ReactElement<Props> {
|
||||
const [isExpanded, toggleIsExpanded] = useToggle(false);
|
||||
const info = chain.workTaskInfo;
|
||||
const firstRecord = chain.workTaskInfo[0];
|
||||
const multiple = info.length > 1;
|
||||
const expandedContent = info.slice(1);
|
||||
|
||||
if (!firstRecord) {
|
||||
return <></>;
|
||||
}
|
||||
|
||||
const renderRow = (record: ChainWorkTaskInformation, idx: number, highlight = false) =>
|
||||
<>
|
||||
<Row
|
||||
chainRecord={record}
|
||||
highlight={highlight}
|
||||
id={chain.id}
|
||||
lastCommittedTimeslice={lastCommittedTimeslice}
|
||||
lease={chain.lease}
|
||||
regionBegin={regionBegin}
|
||||
regionEnd={regionEnd}
|
||||
relayName={relayName}
|
||||
/>
|
||||
{idx === 0 && <td style={{ paddingRight: '2rem', textAlign: 'right', verticalAlign: 'top' }}>
|
||||
|
||||
{!!multiple &&
|
||||
<ExpandButton
|
||||
expanded={isExpanded}
|
||||
onClick={toggleIsExpanded}
|
||||
/>
|
||||
}
|
||||
</td>}
|
||||
</>;
|
||||
|
||||
return (
|
||||
<>
|
||||
<tr
|
||||
className={`isExpanded isFirst ${isExpanded ? '' : 'isLast'}`}
|
||||
key={chain.id}
|
||||
>
|
||||
{renderRow(firstRecord, 0)}
|
||||
</tr>
|
||||
{isExpanded && expandedContent?.map((infoRow, idx) =>
|
||||
<tr key={`${chain.id}${idx}`}>
|
||||
{renderRow(infoRow, idx + 1, true)}
|
||||
</tr>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default React.memo(TeyrchainTableRow);
|
||||
Reference in New Issue
Block a user