- {formatNumber(id)} |
-
+ | {formatNumber(id)} |
+
{(proposal.isApproved || proposal.isScheduled) && (
)}
+ {chainLink}
|
{isQueried && !proposal.proposal
? (
diff --git a/packages/page-parachains/src/util.ts b/packages/page-parachains/src/util.ts
deleted file mode 100644
index 898112840a..0000000000
--- a/packages/page-parachains/src/util.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2017-2021 @polkadot/app-parachains authors & contributors
-// SPDX-License-Identifier: Apache-2.0
-
-import type { Codec } from '@polkadot/types/types';
-
-export function sliceHex (value: Codec, max: number): string {
- const hex = value.toHex();
-
- return `${hex.slice(0, max + 2)}…${hex.slice(-max)}`;
-}
diff --git a/packages/page-parachains/src/util.tsx b/packages/page-parachains/src/util.tsx
new file mode 100644
index 0000000000..5a9488b90c
--- /dev/null
+++ b/packages/page-parachains/src/util.tsx
@@ -0,0 +1,25 @@
+// Copyright 2017-2021 @polkadot/app-parachains authors & contributors
+// SPDX-License-Identifier: Apache-2.0
+
+import type { LinkOption } from '@polkadot/apps-config/settings/types';
+import type { Codec } from '@polkadot/types/types';
+
+import React from 'react';
+
+export function sliceHex (value: Codec, max: number): string {
+ const hex = value.toHex();
+
+ return hex.length > ((2 * max) + 2)
+ ? `${hex.slice(0, max + 2)}…${hex.slice(-max)}`
+ : hex;
+}
+
+export function getChainLink (endpoints: LinkOption[]): React.ReactNode {
+ if (!endpoints.length) {
+ return null;
+ }
+
+ const { text, value } = endpoints[endpoints.length - 1];
+
+ return {text};
+}