feat(EthAccount): add EthAccount edit component

This commit is contained in:
Josep M Sobrepere
2024-12-10 08:32:25 +01:00
parent 59235cd5ed
commit 00d45f2cdb
6 changed files with 4745 additions and 3582 deletions
+25
View File
@@ -0,0 +1,25 @@
import { accountDetail$ } from "@/state/extension-accounts.state"
import { useStateObservable } from "@react-rxjs/core"
import { HexString } from "polkadot-api"
import { FC } from "react"
import { twMerge } from "tailwind-merge"
export const EthAccountDisplay: FC<{
value: HexString
className?: string
}> = ({ value, className }) => {
const { name } = useStateObservable(accountDetail$(value)) ?? {}
return (
<div
className={twMerge(
"flex flex-col justify-center text-foreground leading-tight overflow-hidden",
className,
)}
>
{name && <span className="inline-flex items-center gap-1">{name}</span>}
<span className="text-foreground/50 text-ellipsis overflow-hidden">
{value}
</span>
</div>
)
}