// Copyright 2017-2026 @pezkuwi/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 import type { AddressFlags } from '@pezkuwi/react-hooks/types'; import React from 'react'; import CopyToClipboard from 'react-copy-to-clipboard'; import { useToggle } from '@pezkuwi/react-hooks'; import AccountName from '../AccountName.js'; import Button from '../Button/index.js'; import IdentityIcon from '../IdentityIcon/index.js'; import Input from '../Input.js'; import { useTranslation } from '../translate.js'; interface Props { value: string, editingName: boolean, defaultValue: string, onChange: (value: string) => void, flags: AddressFlags, accountIndex: string | undefined, } function AddressSection ({ accountIndex, defaultValue, editingName, flags, onChange, value }: Props): React.ReactElement { const { t } = useTranslation(); const [isCopyShown, toggleIsCopyShown] = useToggle(); const NOOP = () => undefined; return (
) : flags.isEditable ? (defaultValue.toUpperCase() || t('')) : undefined } value={value} withSidebar={false} />
{value}
{accountIndex && (
{accountIndex}
)}
); } export default React.memo(AddressSection);