// Copyright 2017-2021 @polkadot/vue-identicon authors & contributors // SPDX-License-Identifier: Apache-2.0 import Vue from 'vue'; import { polkadotIcon } from '@polkadot/ui-shared'; interface Data { svgHtml: string; } interface This { address: string; isAlternative?: boolean; } /** * @name Polkadot * @description The Polkadot default identicon */ export const Polkadot = Vue.extend({ created: function (): void { this.createSvgHtml(); }, data: function (): Data { return { // eslint-disable-next-line quotes svgHtml: `` }; }, methods: { createSvgHtml: function (): void { const circles = polkadotIcon(this.address, { isAlternative: (this as This).isAlternative || false }).map(({ cx, cy, fill, r }) => `` ).join(''); this.svgHtml = `${circles}`; } }, props: ['address', 'isAlternative', 'size'], // eslint-disable-next-line quotes template: `
` });