mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-07-11 03:27:24 +00:00
971df8edba
- Remove all 3rd party parachain configurations from endpoints: - productionRelayPolkadot.ts: Keep only system parachains - productionRelayDicle.ts: Keep only system parachains - testingRelayZagros.ts: Keep only system parachains - testingRelayTeyrChain.ts: Keep only system parachains - Update domain references: - polkadot.js.org → pezkuwichain.app - wiki.polkadot.network → wiki.pezkuwichain.io - dotapps.io → pezkuwichain.app - statement.polkadot.network → docs.pezkuwichain.io/statement - support.polkadot.network → docs.pezkuwichain.io - Update repository references: - github.com/pezkuwi-js/apps → github.com/pezkuwichain/pwap - Rename system parachains to Pezkuwi ecosystem: - PolkadotAssetHub → PezkuwiAssetHub - polkadotBridgeHub → pezkuwiBridgeHub - polkadotCollectives → pezkuwiCollectives - polkadotCoretime → pezkuwiCoretime - polkadotPeople → pezkuwiPeople - Update network name in claims utility: - Polkadot → Pezkuwi
148 lines
2.8 KiB
TypeScript
148 lines
2.8 KiB
TypeScript
// Copyright 2017-2026 @pezkuwi/react-components authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import React from 'react';
|
|
|
|
import { styled } from '../styled.js';
|
|
|
|
type HeaderDef = [React.ReactNode?, string?, number?, (() => void)?];
|
|
|
|
interface Props {
|
|
children?: React.ReactNode;
|
|
className?: string;
|
|
filter?: React.ReactNode;
|
|
header?: (false | null | undefined | HeaderDef)[];
|
|
isEmpty: boolean;
|
|
}
|
|
|
|
function Head ({ children, className = '', filter, header, isEmpty }: Props): React.ReactElement<Props> | null {
|
|
if (!header?.length) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<StyledThead className={`${className} ui--Table-Head`}>
|
|
{filter && (
|
|
<tr className='filter'>
|
|
<th colSpan={100}>{filter}</th>
|
|
</tr>
|
|
)}
|
|
<tr>
|
|
{header.filter((h): h is HeaderDef => !!h).map(([label, className = 'default', colSpan = 1, onClick], index) =>
|
|
<th
|
|
className={className}
|
|
colSpan={colSpan}
|
|
key={index}
|
|
onClick={onClick}
|
|
>
|
|
{index === 0
|
|
? <h1>{label}</h1>
|
|
: !isEmpty && label && <label>{label}</label>
|
|
}
|
|
</th>
|
|
)}
|
|
</tr>
|
|
{children}
|
|
</StyledThead>
|
|
);
|
|
}
|
|
|
|
const StyledThead = styled.thead`
|
|
z-index: 1;
|
|
|
|
th {
|
|
background: var(--bg-table);
|
|
font: var(--font-sans);
|
|
font-weight: var(--font-weight-normal);
|
|
padding: 0.375rem 1rem;
|
|
text-align: right;
|
|
vertical-align: middle;
|
|
white-space: nowrap;
|
|
|
|
h1 {
|
|
display: table-cell;
|
|
vertical-align: middle;
|
|
|
|
.sub {
|
|
display: inline-block;
|
|
font-size: var(--font-size-base);
|
|
font-weight: var(--font-weight-normal);
|
|
opacity: var(--opacity-light);
|
|
padding-left: 1.5rem;
|
|
text-overflow: ellipsis;
|
|
vertical-align: middle;
|
|
}
|
|
}
|
|
|
|
> label {
|
|
margin: 0 !important;
|
|
}
|
|
|
|
&.address {
|
|
padding-left: 3rem;
|
|
text-align: left;
|
|
}
|
|
|
|
&.badge {
|
|
padding: 0;
|
|
}
|
|
|
|
&.expand,
|
|
&.number {
|
|
text-align: right;
|
|
}
|
|
|
|
&.isClickable {
|
|
cursor: pointer;
|
|
}
|
|
|
|
&.mini {
|
|
padding: 0 !important;
|
|
}
|
|
|
|
&.no-pad-left {
|
|
padding-left: 0.125rem;
|
|
}
|
|
|
|
&.no-pad-right {
|
|
padding-right: 0.125rem;
|
|
}
|
|
|
|
&.start {
|
|
text-align: left;
|
|
}
|
|
|
|
&.balances {
|
|
text-align: right;
|
|
padding-right: 2.25rem;
|
|
}
|
|
}
|
|
|
|
tr {
|
|
text-transform: lowercase;
|
|
|
|
&.filter {
|
|
.ui.input,
|
|
.ui.selection.dropdown {
|
|
background: transparent;
|
|
|
|
&:first-child {
|
|
margin-top: 0;
|
|
}
|
|
}
|
|
|
|
th {
|
|
padding: 0;
|
|
}
|
|
}
|
|
|
|
&:not(.filter) {
|
|
th {
|
|
color: var(--color-table-head);
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
export default React.memo(Head);
|