diff --git a/app/components/common/Downloadable.tsx b/app/components/common/Downloadable.tsx index d3c93aa0..67b15da0 100644 --- a/app/components/common/Downloadable.tsx +++ b/app/components/common/Downloadable.tsx @@ -1,7 +1,15 @@ import { ComponentType, ReactNode } from 'react'; import { Download, IconProps } from 'react-feather'; -export function DownloadableIcon({ data, filename, children }: { data: string; filename: string; children: ReactNode }) { +export function DownloadableIcon({ + data, + filename, + children, +}: { + data: string; + filename: string; + children: ReactNode; +}) { const handleClick = async () => { const blob = new Blob([Buffer.from(data, 'base64')]); const fileDownloadUrl = URL.createObjectURL(blob); @@ -19,18 +27,18 @@ export function DownloadableIcon({ data, filename, children }: { data: string; f ); } -export function DownloadableButton({ - data, - filename, - children, +export function DownloadableButton({ + data, + filename, + children, type, - icon: Icon = Download as ComponentType -}: { - data: string; - filename: string; + icon: Icon = Download as ComponentType, +}: { + data: string; + filename: string; children?: ReactNode; type?: string; - icon?: ComponentType + icon?: ComponentType; }) { const handleDownload = async () => { const blob = new Blob([Buffer.from(data, 'base64')], type ? { type } : {}); @@ -48,4 +56,3 @@ export function DownloadableButton({ ); } - diff --git a/app/components/common/IDLBadge.tsx b/app/components/common/IDLBadge.tsx index b1ceb161..cdb847be 100644 --- a/app/components/common/IDLBadge.tsx +++ b/app/components/common/IDLBadge.tsx @@ -3,16 +3,12 @@ import React from 'react'; import { IdlSpec } from '@/app/utils/convertLegacyIdl'; interface IDLBadgeProps { - spec: IdlSpec + spec: IdlSpec; } export function IDLBadge({ spec }: IDLBadgeProps) { - const badgeClass = spec === 'legacy' ? 'bg-warning' : 'bg-success'; - const badgeText = spec === 'legacy' ? 'Legacy' : '0.30.1'; + const badgeClass = spec === 'legacy' ? 'bg-warning' : 'bg-success'; + const badgeText = spec === 'legacy' ? 'Legacy' : '0.30.1'; - return ( - - {badgeText} Anchor IDL - - ); -} \ No newline at end of file + return {badgeText} Anchor IDL; +} diff --git a/app/types/react-json-view.d.ts b/app/types/react-json-view.d.ts index ce08f9ec..20800da1 100644 --- a/app/types/react-json-view.d.ts +++ b/app/types/react-json-view.d.ts @@ -1,7 +1,7 @@ import 'react-json-view'; declare module 'react-json-view' { - interface ReactJsonViewProps { - displayArrayKey?: boolean; - } -} \ No newline at end of file + interface ReactJsonViewProps { + displayArrayKey?: boolean; + } +} diff --git a/app/utils/anchor.tsx b/app/utils/anchor.tsx index a28bfba9..e305793a 100644 --- a/app/utils/anchor.tsx +++ b/app/utils/anchor.tsx @@ -221,10 +221,22 @@ function mapField(key: string, value: any, type: IdlType, idl: Idl, keySuffix?: keySuffix={keySuffix} nestingLevel={nestingLevel} > -
{(value as Buffer).toString('base64')}
- +
+ {(value as Buffer).toString('base64')} +
+ ); - }else if (type === 'pubkey') { + } else if (type === 'pubkey') { return (