mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-06-14 01:01:03 +00:00
22 lines
547 B
TypeScript
22 lines
547 B
TypeScript
// Copyright 2017-2020 @polkadot/react-identicon authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { Props } from '../types';
|
|
|
|
import jdenticon from 'jdenticon';
|
|
import React from 'react';
|
|
|
|
function Identicon ({ className = '', publicKey, size, style }: Props): React.ReactElement<Props> {
|
|
return (
|
|
<div
|
|
className={className}
|
|
dangerouslySetInnerHTML={{
|
|
__html: jdenticon.toSvg(publicKey.substr(2), size)
|
|
}}
|
|
style={style}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export const Jdenticon = React.memo(Identicon);
|