Files
pezkuwi-apps/packages/page-claims/src/Warning.tsx
T
Satoshi Qazi Muhammed 45d479d2ec Move to @pezkuwi/dev 0.86.4 (eslint 10 toolchain)
- dev ^0.86.4 at the root and in packages/apps; directives renamed by
  pezkuwi-dev-migrate-eslint10.
- eslint --fix with the 0.86.4 config; one fix broke syntax
  (typescript-eslint prefer-optional-chain turned
  `(isStarted && onStart) && onStart()` into `(isStarted && onStart?.();`
  in TxButton) and is corrected by hand.
- The remaining findings fixed rather than disabled: optional chains
  (each suggestion reviewed), `cause` on rethrown errors, `if` instead of
  `a && promise` in effects, parallel instead of sequential awaits in
  Promise.all, Error rejections, no `delete` on arrays (the storage query
  cache is a Map; an upload's file list no longer keeps a hole), no
  `[object Object]` stringification (TFunction's second argument is text
  or options), dead code removed (referenda's never-shown expand button,
  react-query's unused CoreDescriptor).
2026-10-10 02:06:12 +04:00

58 lines
1.3 KiB
TypeScript

// Copyright 2017-2026 @pezkuwi/app-claims authors & contributors
// SPDX-License-Identifier: Apache-2.0
import React from 'react';
import { AddressMini, Card, styled } from '@pezkuwi/react-components';
import { useTranslation } from './translate.js';
import usePezkuwiPreclaims from './usePezkuwiPreclaims.js';
export interface Props {
className?: string;
}
function Warning ({ className }: Props): React.ReactElement<Props> | null {
const { t } = useTranslation();
const needsAttest = usePezkuwiPreclaims();
if (!needsAttest.length) {
return null;
}
return (
<Card isError>
<StyledDiv className={className}>
{
needsAttest.length > 1
? t('You need to sign an attestation for the following accounts:')
: t('You need to sign an attestation for the following account:')
}{
needsAttest.map((address) => (
<AddressMini
key={address}
value={address}
/>
))
}
</StyledDiv>
</Card>
);
}
const StyledDiv = styled.div`
font-size: var(--font-size-h3);
display: flex;
flex-direction: column;
justify-content: center;
min-height: 8rem;
align-items: center;
margin: 0 1rem;
.ui--AddressMini-address {
max-width: 20rem;
}
`;
export default React.memo(Warning);