View History
avail-widgets/view-historyFreeComponent
Deprecated: use Nexus Widget instead. View History has been removed. Use sdk.getMyIntents() for programmatic access.
Install it
npx shadcn@latest add https://elements.nexus.availproject.org/r/view-history.jsonSource
1"use client";23import {4 Dialog,5 DialogContent,6 DialogHeader,7 DialogTrigger,8 DialogTitle,9} from "@/registry/avail-widgets/ui/dialog";10import { Clock, LoaderPinwheel, SquareArrowOutUpRight } from "lucide-react";11import { TOKEN_METADATA } from "../common";12import { type IntentRecord } from "@avail-project/nexus-core";13import { cn } from "@/lib/utils";14import { Badge } from "@/registry/avail-widgets/ui/badge";15import { Button } from "@/registry/avail-widgets/ui/button";16import { Card } from "@/registry/avail-widgets/ui/card";17import { Separator } from "@/registry/avail-widgets/ui/separator";18import useViewHistory from "./hooks/useViewHistory";19import { useEffect, useState } from "react";2021const TOKEN_ICON_FALLBACKS: Record<string, string> = {22 USDM:23 "https://raw.githubusercontent.com/availproject/nexus-assets/main/tokens/usdm/logo.png",24};2526function resolveTokenMetadata(symbol?: string) {27 const normalized = symbol?.trim() ?? "";28 if (!normalized) {29 return { icon: "", name: "token" };30 }3132 const upper = normalized.toUpperCase();33 const normalizedMetadata =34 TOKEN_METADATA[normalized as keyof typeof TOKEN_METADATA];35 const upperMetadata = TOKEN_METADATA[upper as keyof typeof TOKEN_METADATA];3637 const icon =38 normalizedMetadata?.logo ||39 upperMetadata?.logo ||40 TOKEN_ICON_FALLBACKS[normalized] ||41 TOKEN_ICON_FALLBACKS[upper] ||42 "";43 const name = normalizedMetadata?.name || upperMetadata?.name || upper;4445 return { icon, name };46}4748const SourceChains = ({ sources }: { sources: IntentRecord["sources"] }) => {49 const sourceList = sources ?? [];50 return (51 <div className="flex items-center">52 {sourceList.map((source, index) => (53 <div54 key={source?.chain?.id}55 className={cn(56 "rounded-full transition-transform hover:scale-110",57 index > 0 && "-ml-2"58 )}59 style={{ zIndex: sourceList.length - index }}60 >61 <img62 src={source?.chain?.logo}63 alt={source?.chain?.name}64 width={24}65 height={24}66 className="rounded-full"67 />68 </div>69 ))}70 </div>71 );72};7374const StatusBadge = ({ status }: { status: string }) => {75 const getVariant = (status: string) => {76 if (status === "Fulfilled") {77 return "default";78 } else if (status === "Deposited") {79 return "secondary";80 } else if (status === "Refunded") {81 return "outline";82// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from avail-widgets
All 27 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | avail-widgets | Components | Free | 2 deps | |
| All Elementsall | avail-widgets | Components | Free | no deps | |
| Animated Spinneranimated-spinner | avail-widgets | Components | Free | no deps | |
| Badgebadge | avail-widgets | Components | Free | 2 deps | |
| Bridge Depositbridge-deposit | avail-widgets | Components | Free | 3 deps · 32 files | |
| Buttonbutton | avail-widgets | Components | Free | 2 deps | |
| Cardcard | avail-widgets | Components | Free | no deps | |
| Checkboxcheckbox | avail-widgets | Components | Free | 2 deps |
