11"use client" ;
22
3+ import { ChainName } from "@/app/config/blockchain" ;
4+ import { LINKS } from "@/app/config/constants" ;
5+ import Link from "next/link" ;
36import { isAddress } from "viem" ;
47
58interface SubaccountsListProps {
69 userInput : string ;
10+ selectedChain : ChainName ;
711 subaccounts : string [ ] ;
812 selectedAccounts : string [ ] ;
913 onSelectAccount : ( account : string ) => void ;
@@ -20,39 +24,60 @@ export function SubaccountsList({
2024 onDownloadClick,
2125 isLoading = false ,
2226 isDownloading = false ,
27+ selectedChain,
2328} : SubaccountsListProps ) {
2429 const isDownloadDisabled = selectedAccounts . length === 0 || isDownloading ;
30+ const isBlast = selectedChain === "Blast" ;
2531
2632 return (
27- < div className = "w-full max-w-4xl space-y-6" >
33+ < div className = "w-full max-w-4xl flex flex-col gap-6" >
34+ { isBlast && (
35+ < p className = "text-[#FCAA0D]" >
36+ Blast Accounts aren't supported on the Safe Ul. Head to Protofire
37+ to manage your Sub-Accounts.
38+ </ p >
39+ ) }
2840 { /* Download Button */ }
29- < div className = "flex justify-center" >
30- < button
31- onClick = { onDownloadClick }
32- disabled = { isDownloadDisabled }
33- className = { `flex w-full px-2 py-2 justify-center items-center rounded-lg text-sm font-medium leading-6 transition-all ${
34- isDownloadDisabled
35- ? "bg-[#494C56] text-[#A8ADB5] cursor-not-allowed gap-1"
36- : "bg-white text-black cursor-pointer gap-[6px]"
37- } `}
38- >
39- { isDownloading ? (
40- < >
41- < div className = "animate-spin rounded-full h-5 w-5 border-2 border-gray-400 border-t-black" > </ div >
42- Generating...
43- </ >
44- ) : (
45- < >
46- < DownloadIcon disabled = { isDownloadDisabled } /> { " " }
47- { selectedAccounts . length > 0
48- ? ` Download Json file (${ selectedAccounts . length } Selected)`
49- : userInput
50- ? "Select Sub-Accounts to download JSON"
51- : "Enter Account Address to view Sub-Accounts" }
52- </ >
53- ) }
54- </ button >
55- </ div >
41+
42+ { isBlast ? (
43+ < Link href = { LINKS . PROTOFIRE } target = "_blank" >
44+ { " " }
45+ < button
46+ className = { `flex w-full px-2 py-2 justify-center items-center rounded-lg text-sm font-medium leading-6 transition-all bg-white text-black cursor-pointer gap-[6px]` }
47+ >
48+ Open on Protofire
49+ </ button >
50+ </ Link >
51+ ) : (
52+ < div className = "flex justify-center" >
53+ < button
54+ onClick = { onDownloadClick }
55+ disabled = { isDownloadDisabled }
56+ className = { `flex w-full px-2 py-2 justify-center items-center rounded-lg text-sm font-medium leading-6 transition-all ${
57+ isDownloadDisabled
58+ ? "bg-[#494C56] text-[#A8ADB5] cursor-not-allowed gap-1"
59+ : "bg-white text-black cursor-pointer gap-[6px]"
60+ } `}
61+ >
62+ { isDownloading ? (
63+ < >
64+ < div className = "animate-spin rounded-full h-5 w-5 border-2 border-gray-400 border-t-black" > </ div >
65+ Generating...
66+ </ >
67+ ) : (
68+ < >
69+ < DownloadIcon disabled = { isDownloadDisabled } /> { " " }
70+ { selectedAccounts . length > 0
71+ ? ` Download Json file (${ selectedAccounts . length } Selected)`
72+ : userInput
73+ ? "Select Sub-Accounts to download JSON"
74+ : "Enter Account Address to view Sub-Accounts" }
75+ </ >
76+ ) }
77+ </ button >
78+ </ div >
79+ ) }
80+
5681 { /* Subaccounts Container */ }
5782 { ! isAddress ( userInput ) ? (
5883 // Placeholder when no input
0 commit comments