@medialane/ui 0.201.9 → 0.202.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/account/input-otp.d.cts +2 -2
- package/dist/components/account/input-otp.d.ts +2 -2
- package/dist/components/activity-card.cjs +6 -5
- package/dist/components/activity-card.cjs.map +1 -1
- package/dist/components/activity-card.d.cts +1 -2
- package/dist/components/activity-card.d.ts +1 -2
- package/dist/components/activity-card.js +6 -5
- package/dist/components/activity-card.js.map +1 -1
- package/dist/components/activity-row.cjs +7 -7
- package/dist/components/activity-row.cjs.map +1 -1
- package/dist/components/activity-row.d.cts +1 -3
- package/dist/components/activity-row.d.ts +1 -3
- package/dist/components/activity-row.js +7 -7
- package/dist/components/activity-row.js.map +1 -1
- package/dist/components/activity-ticker.cjs +3 -2
- package/dist/components/activity-ticker.cjs.map +1 -1
- package/dist/components/activity-ticker.js +3 -2
- package/dist/components/activity-ticker.js.map +1 -1
- package/dist/components/activity-timeline-row.cjs +3 -3
- package/dist/components/activity-timeline-row.cjs.map +1 -1
- package/dist/components/activity-timeline-row.d.cts +1 -2
- package/dist/components/activity-timeline-row.d.ts +1 -2
- package/dist/components/activity-timeline-row.js +3 -3
- package/dist/components/activity-timeline-row.js.map +1 -1
- package/dist/components/animated-token-media.cjs +0 -1
- package/dist/components/animated-token-media.cjs.map +1 -1
- package/dist/components/animated-token-media.js +0 -1
- package/dist/components/animated-token-media.js.map +1 -1
- package/dist/components/asset-access-cards.d.cts +1 -0
- package/dist/components/asset-access-cards.d.ts +1 -0
- package/dist/components/asset-card.cjs +3 -2
- package/dist/components/asset-card.cjs.map +1 -1
- package/dist/components/asset-card.js +3 -2
- package/dist/components/asset-card.js.map +1 -1
- package/dist/components/asset-lightbox.cjs +0 -1
- package/dist/components/asset-lightbox.cjs.map +1 -1
- package/dist/components/asset-lightbox.js +0 -1
- package/dist/components/asset-lightbox.js.map +1 -1
- package/dist/components/asset-marketplace-panel.d.cts +1 -0
- package/dist/components/asset-marketplace-panel.d.ts +1 -0
- package/dist/components/asset-owners-panel.cjs +2 -1
- package/dist/components/asset-owners-panel.cjs.map +1 -1
- package/dist/components/asset-owners-panel.js +2 -1
- package/dist/components/asset-owners-panel.js.map +1 -1
- package/dist/components/asset-page.cjs +14 -12
- package/dist/components/asset-page.cjs.map +1 -1
- package/dist/components/asset-page.js +15 -13
- package/dist/components/asset-page.js.map +1 -1
- package/dist/components/asset-top-sections.cjs +0 -2
- package/dist/components/asset-top-sections.cjs.map +1 -1
- package/dist/components/asset-top-sections.js +0 -2
- package/dist/components/asset-top-sections.js.map +1 -1
- package/dist/components/badge.d.cts +1 -1
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/button.d.cts +2 -2
- package/dist/components/button.d.ts +2 -2
- package/dist/components/coin-row.cjs +3 -2
- package/dist/components/coin-row.cjs.map +1 -1
- package/dist/components/coin-row.js +3 -2
- package/dist/components/coin-row.js.map +1 -1
- package/dist/components/collection-card.cjs +3 -2
- package/dist/components/collection-card.cjs.map +1 -1
- package/dist/components/collection-card.js +3 -2
- package/dist/components/collection-card.js.map +1 -1
- package/dist/components/collection-header.cjs +3 -2
- package/dist/components/collection-header.cjs.map +1 -1
- package/dist/components/collection-header.js +3 -2
- package/dist/components/collection-header.js.map +1 -1
- package/dist/components/creation-record.cjs +2 -1
- package/dist/components/creation-record.cjs.map +1 -1
- package/dist/components/creation-record.js +2 -1
- package/dist/components/creation-record.js.map +1 -1
- package/dist/components/creator-chip.cjs +2 -1
- package/dist/components/creator-chip.cjs.map +1 -1
- package/dist/components/creator-chip.js +2 -1
- package/dist/components/creator-chip.js.map +1 -1
- package/dist/components/discover-creators-strip.cjs +3 -2
- package/dist/components/discover-creators-strip.cjs.map +1 -1
- package/dist/components/discover-creators-strip.js +3 -2
- package/dist/components/discover-creators-strip.js.map +1 -1
- package/dist/components/discover-feed-section.cjs +1 -2
- package/dist/components/discover-feed-section.cjs.map +1 -1
- package/dist/components/discover-feed-section.d.cts +1 -3
- package/dist/components/discover-feed-section.d.ts +1 -3
- package/dist/components/discover-feed-section.js +1 -2
- package/dist/components/discover-feed-section.js.map +1 -1
- package/dist/components/drop/drop-card.cjs +3 -2
- package/dist/components/drop/drop-card.cjs.map +1 -1
- package/dist/components/drop/drop-card.js +3 -2
- package/dist/components/drop/drop-card.js.map +1 -1
- package/dist/components/drop/page/drop-page.cjs +4 -3
- package/dist/components/drop/page/drop-page.cjs.map +1 -1
- package/dist/components/drop/page/drop-page.js +4 -3
- package/dist/components/drop/page/drop-page.js.map +1 -1
- package/dist/components/fast-mint/fast-mint.cjs +5 -3
- package/dist/components/fast-mint/fast-mint.cjs.map +1 -1
- package/dist/components/fast-mint/fast-mint.d.cts +2 -2
- package/dist/components/fast-mint/fast-mint.d.ts +2 -2
- package/dist/components/fast-mint/fast-mint.js +5 -3
- package/dist/components/fast-mint/fast-mint.js.map +1 -1
- package/dist/components/featured-carousel.cjs +3 -2
- package/dist/components/featured-carousel.cjs.map +1 -1
- package/dist/components/featured-carousel.js +3 -2
- package/dist/components/featured-carousel.js.map +1 -1
- package/dist/components/hero-slider.cjs +3 -2
- package/dist/components/hero-slider.cjs.map +1 -1
- package/dist/components/hero-slider.js +3 -2
- package/dist/components/hero-slider.js.map +1 -1
- package/dist/components/listing-card.cjs +3 -2
- package/dist/components/listing-card.cjs.map +1 -1
- package/dist/components/listing-card.js +3 -2
- package/dist/components/listing-card.js.map +1 -1
- package/dist/components/make-offer-picker.cjs +3 -2
- package/dist/components/make-offer-picker.cjs.map +1 -1
- package/dist/components/make-offer-picker.js +3 -2
- package/dist/components/make-offer-picker.js.map +1 -1
- package/dist/components/medialane-app.cjs +2 -0
- package/dist/components/medialane-app.cjs.map +1 -1
- package/dist/components/medialane-app.d.cts +5 -1
- package/dist/components/medialane-app.d.ts +5 -1
- package/dist/components/medialane-app.js +1 -0
- package/dist/components/medialane-app.js.map +1 -1
- package/dist/components/nav-command-menu.cjs +141 -16
- package/dist/components/nav-command-menu.cjs.map +1 -1
- package/dist/components/nav-command-menu.d.cts +4 -2
- package/dist/components/nav-command-menu.d.ts +4 -2
- package/dist/components/nav-command-menu.js +141 -17
- package/dist/components/nav-command-menu.js.map +1 -1
- package/dist/components/portfolio-activity.cjs +1 -3
- package/dist/components/portfolio-activity.cjs.map +1 -1
- package/dist/components/portfolio-activity.js +1 -3
- package/dist/components/portfolio-activity.js.map +1 -1
- package/dist/components/result-thumbnail.cjs +60 -0
- package/dist/components/result-thumbnail.cjs.map +1 -0
- package/dist/components/result-thumbnail.d.cts +9 -0
- package/dist/components/result-thumbnail.d.ts +9 -0
- package/dist/components/result-thumbnail.js +26 -0
- package/dist/components/result-thumbnail.js.map +1 -0
- package/dist/components/router.cjs +4 -2
- package/dist/components/router.cjs.map +1 -1
- package/dist/components/router.d.cts +1 -1
- package/dist/components/router.d.ts +1 -1
- package/dist/components/router.js +3 -2
- package/dist/components/router.js.map +1 -1
- package/dist/components/search-page.cjs +178 -0
- package/dist/components/search-page.cjs.map +1 -0
- package/dist/components/search-page.d.cts +5 -0
- package/dist/components/search-page.d.ts +5 -0
- package/dist/components/search-page.js +144 -0
- package/dist/components/search-page.js.map +1 -0
- package/dist/components/sheet.d.cts +1 -1
- package/dist/components/sheet.d.ts +1 -1
- package/dist/components/token-card.cjs +3 -2
- package/dist/components/token-card.cjs.map +1 -1
- package/dist/components/token-card.js +3 -2
- package/dist/components/token-card.js.map +1 -1
- package/dist/data/nav-commands.cjs +85 -0
- package/dist/data/nav-commands.cjs.map +1 -0
- package/dist/data/nav-commands.d.cts +342 -0
- package/dist/data/nav-commands.d.ts +342 -0
- package/dist/data/nav-commands.js +89 -0
- package/dist/data/nav-commands.js.map +1 -0
- package/dist/index.cjs +23 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +16 -2
- package/dist/index.js.map +1 -1
- package/dist/utils/format-activity.cjs +9 -8
- package/dist/utils/format-activity.cjs.map +1 -1
- package/dist/utils/format-activity.d.cts +5 -4
- package/dist/utils/format-activity.d.ts +5 -4
- package/dist/utils/format-activity.js +10 -9
- package/dist/utils/format-activity.js.map +1 -1
- package/dist/utils/ipfs.cjs +6 -1
- package/dist/utils/ipfs.cjs.map +1 -1
- package/dist/utils/ipfs.d.cts +6 -1
- package/dist/utils/ipfs.d.ts +6 -1
- package/dist/utils/ipfs.js +5 -1
- package/dist/utils/ipfs.js.map +1 -1
- package/dist/utils/token-profile-link.cjs +3 -2
- package/dist/utils/token-profile-link.cjs.map +1 -1
- package/dist/utils/token-profile-link.js +3 -2
- package/dist/utils/token-profile-link.js.map +1 -1
- package/dist/utils/use-image-url.cjs +36 -0
- package/dist/utils/use-image-url.cjs.map +1 -0
- package/dist/utils/use-image-url.d.cts +5 -0
- package/dist/utils/use-image-url.d.ts +5 -0
- package/dist/utils/use-image-url.js +12 -0
- package/dist/utils/use-image-url.js.map +1 -0
- package/dist/utils/use-notifications.cjs +7 -5
- package/dist/utils/use-notifications.cjs.map +1 -1
- package/dist/utils/use-notifications.js +7 -5
- package/dist/utils/use-notifications.js.map +1 -1
- package/dist/utils/use-search.cjs +59 -0
- package/dist/utils/use-search.cjs.map +1 -0
- package/dist/utils/use-search.d.cts +14 -0
- package/dist/utils/use-search.d.ts +14 -0
- package/dist/utils/use-search.js +24 -0
- package/dist/utils/use-search.js.map +1 -0
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/coin-row.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport Image from \"./image.js\";\nimport { cn } from \"../utils/cn.js\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/components/coin-row.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport Image from \"./image.js\";\nimport { cn } from \"../utils/cn.js\";\nimport { DualPrice } from \"./dual-price.js\";\nimport {\n coinKind, coinKindLabel, coinAccentToken,\n type CoinCollectionLike, type CoinPriceLike,\n} from \"../data/coins.js\";\nimport { formatUsdPrice } from \"../utils/format.js\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\n\nexport type CoinMarketStatus = \"live\" | \"pre-launch\" | \"unavailable\";\n\nexport type UseCoinPrice = (collection: CoinCollectionLike) => {\n price: CoinPriceLike | null;\n status?: CoinMarketStatus;\n isLoading: boolean;\n};\n\nexport const COIN_GRID = \"grid grid-cols-[minmax(0,1fr)_auto] items-center gap-3 sm:gap-4\";\n\nexport interface CoinRowProps {\n collection: CoinCollectionLike;\n usePrice: UseCoinPrice;\n href: string;\n showKind?: boolean;\n}\n\nexport function CoinAvatar({ collection, size = 36 }: { collection: CoinCollectionLike; size?: number }) {\n const resolveImage = useImageUrl();\n const logoUri = collection.profile?.image ?? collection.image;\n const logo = resolveImage(logoUri);\n const initials = (collection.symbol ?? collection.name ?? \"?\").trim().slice(0, 2).toUpperCase();\n const accent = coinAccentToken(collection.symbol ?? collection.name ?? collection.contractAddress);\n\n return (\n <div\n className={cn(\"relative shrink-0 overflow-hidden rounded-full\", accent)}\n style={{ width: size, height: size }}\n >\n {logo ? (\n <Image src={logo} alt=\"\" fill sizes={`${size}px`} className=\"object-cover\" unoptimized />\n ) : (\n <span\n className=\"flex h-full w-full items-center justify-center font-bold leading-none text-white\"\n style={{ fontSize: size * 0.36 }}\n >\n {initials}\n </span>\n )}\n </div>\n );\n}\n\nfunction PriceCell({ price, status, isLoading }: { price: CoinPriceLike | null; status?: CoinMarketStatus; isLoading: boolean }) {\n if (isLoading) return <span className=\"ml-auto block h-4 w-16 animate-pulse rounded bg-muted-foreground/20\" />;\n if (!price) {\n return status === \"pre-launch\" ? (\n <span className=\"block text-right text-xs text-muted-foreground\">Not trading yet</span>\n ) : (\n <span\n className=\"block text-right text-muted-foreground\"\n title=\"No liquidity route was found for this coin on any Starknet DEX yet.\"\n >\n —\n </span>\n );\n }\n\n const usd = price.quoteUsdRate != null ? formatUsdPrice(price.quotePerCoin * price.quoteUsdRate) : null;\n\n return (\n <span className=\"flex justify-end\">\n <DualPrice\n amountFormatted={String(price.quotePerCoin)}\n currency={price.quoteSymbol}\n usdValue={usd}\n scale=\"card\"\n secondaryClassName=\"hidden sm:flex\"\n />\n </span>\n );\n}\n\nexport function CoinRow({ collection, usePrice, href, showKind = false }: CoinRowProps) {\n const { price, status, isLoading } = usePrice(collection);\n\n return (\n <Link\n href={href}\n className={cn(\n COIN_GRID,\n \"border-b border-border/40 px-2 py-2.5 text-sm transition-colors\",\n \"hover:bg-muted/40 active:bg-muted/60\"\n )}\n >\n <span className=\"flex min-w-0 items-center gap-3\">\n <CoinAvatar collection={collection} />\n <span className=\"min-w-0\">\n <span className=\"block truncate font-semibold leading-tight\">{collection.name ?? \"Untitled coin\"}</span>\n <span className=\"block truncate text-xs text-muted-foreground\">\n {collection.symbol ?? \"—\"}\n {showKind && <span className=\"text-muted-foreground/60\"> · {coinKindLabel(coinKind(collection.service))}</span>}\n </span>\n </span>\n </span>\n\n <PriceCell price={price} status={status} isLoading={isLoading} />\n </Link>\n );\n}\n\nexport function CoinRowSkeleton() {\n return (\n <div className={cn(COIN_GRID, \"border-b border-border/40 px-2 py-2.5\")}>\n <span className=\"flex items-center gap-3\">\n <span className=\"h-9 w-9 shrink-0 animate-pulse rounded-full bg-muted-foreground/20\" />\n <span className=\"space-y-1.5\">\n <span className=\"block h-4 w-28 animate-pulse rounded bg-muted-foreground/20\" />\n <span className=\"block h-3 w-14 animate-pulse rounded bg-muted-foreground/10\" />\n </span>\n </span>\n <span className=\"ml-auto block h-4 w-16 animate-pulse rounded bg-muted-foreground/20\" />\n </div>\n );\n}\n"],"mappings":";AA2CQ,cA6DiB,YA7DjB;AAzCR,OAAO,UAAU;AACjB,OAAO,WAAW;AAClB,SAAS,UAAU;AACnB,SAAS,iBAAiB;AAC1B;AAAA,EACE;AAAA,EAAU;AAAA,EAAe;AAAA,OAEpB;AACP,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAUrB,MAAM,YAAY;A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EJ;AAEO,SAAS,QAAQ,EAAE,YAAY,UAAU,MAAM,WAAW,MAAM,GAAiB;AACtF,QAAM,EAAE,OAAO,QAAQ,UAAU,IAAI,SAAS,UAAU;AAExD,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MAEA;AAAA,6BAAC,UAAK,WAAU,mCACd;AAAA,8BAAC,cAAW,YAAwB;AAAA,UACpC,qBAAC,UAAK,WAAU,WACd;AAAA,gCAAC,UAAK,WAAU,8CAA8C,qBAAW,QAAQ,iBAAgB;AAAA,YACjG,qBAAC,UAAK,WAAU,gDACb;AAAA,yBAAW,UAAU;AAAA,cACrB,YAAY,qBAAC,UAAK,WAAU,4BAA2B;AAAA;AAAA,gBAAI,cAAc,SAAS,WAAW,OAAO,CAAC;AAAA,iBAAE;AAAA,eAC1G;AAAA,aACF;AAAA,WACF;AAAA,QAEA,oBAAC,aAAU,OAAc,QAAgB,WAAsB;AAAA;AAAA;AAAA,EACjE;AAEJ;AAEO,SAAS,kBAAkB;AAChC,SACE,qBAAC,SAAI,WAAW,GAAG,WAAW,uCAAuC,GACnE;AAAA,yBAAC,UAAK,WAAU,2BACd;AAAA,0BAAC,UAAK,WAAU,sEAAqE;AAAA,MACrF,qBAAC,UAAK,WAAU,eACd;AAAA,4BAAC,UAAK,WAAU,+DAA8D;AAAA,QAC9E,oBAAC,UAAK,WAAU,+DAA8D;AAAA,SAChF;AAAA,OACF;AAAA,IACA,oBAAC,UAAK,WAAU,uEAAsE;AAAA,KACxF;AAEJ;","names":[]}
|
|
@@ -39,10 +39,10 @@ var import_link = __toESM(require("./link.js"), 1);
|
|
|
39
39
|
var import_image = __toESM(require("./image.js"), 1);
|
|
40
40
|
var import_lucide_react = require("lucide-react");
|
|
41
41
|
var import_cn = require("../utils/cn.js");
|
|
42
|
-
var import_ipfs = require("../utils/ipfs.js");
|
|
43
42
|
var import_format = require("../utils/format.js");
|
|
44
43
|
var import_motion_primitives = require("./motion-primitives.js");
|
|
45
44
|
var import_currency_icon = require("./currency-icon.js");
|
|
45
|
+
var import_use_image_url = require("../utils/use-image-url.js");
|
|
46
46
|
function parseFloorPrice(floor) {
|
|
47
47
|
if (!floor) return null;
|
|
48
48
|
const formatted = (0, import_format.formatDisplayPrice)(floor);
|
|
@@ -53,8 +53,9 @@ function parseFloorPrice(floor) {
|
|
|
53
53
|
return { amount, symbol };
|
|
54
54
|
}
|
|
55
55
|
function CollectionCard({ collection, href, settingsHref, className }) {
|
|
56
|
+
const resolveImage = (0, import_use_image_url.useImageUrl)();
|
|
56
57
|
const [imgError, setImgError] = (0, import_react.useState)(false);
|
|
57
|
-
const imageUrl =
|
|
58
|
+
const imageUrl = resolveImage(collection.image, { width: 480 });
|
|
58
59
|
const showImage = imageUrl && !imgError;
|
|
59
60
|
const initial = (collection.name ?? collection.contractAddress).charAt(0).toUpperCase();
|
|
60
61
|
const floor = parseFloorPrice(collection.floorPrice);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/collection-card.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport Link from \"./link.js\";\nimport Image from \"./image.js\";\nimport { Loader2, Settings2 } from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/components/collection-card.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport Link from \"./link.js\";\nimport Image from \"./image.js\";\nimport { Loader2, Settings2 } from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { MotionCard } from \"./motion-primitives.js\";\nimport { CurrencyIcon } from \"./currency-icon.js\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\n\nfunction parseFloorPrice(floor: string | null | undefined): { amount: string; symbol: string } | null {\n if (!floor) return null;\n const formatted = formatDisplayPrice(floor);\n const parts = formatted.trim().split(/\\s+/);\n if (parts.length < 2) return null;\n const symbol = parts[parts.length - 1];\n const amount = parts.slice(0, -1).join(\" \");\n return { amount, symbol };\n}\n\ntype CollectionWithProfile = ApiCollection & {\n profile?: { hasGatedContent?: boolean } | null;\n};\n\nexport interface CollectionCardProps {\n collection: ApiCollection;\n\n href?: string;\n\n settingsHref?: string;\n className?: string;\n}\n\nexport function CollectionCard({ collection, href, settingsHref, className }: CollectionCardProps) {\n const resolveImage = useImageUrl();\n const [imgError, setImgError] = useState(false);\n const imageUrl = resolveImage(collection.image, { width: 480 });\n const showImage = imageUrl && !imgError;\n const initial = (collection.name ?? collection.contractAddress).charAt(0).toUpperCase();\n const floor = parseFloorPrice(collection.floorPrice);\n const hasExclusiveContent = !!(collection as CollectionWithProfile).profile?.hasGatedContent;\n\n return (\n <div className={cn(hasExclusiveContent && \"card-exclusive-wrapper btn-border-animated\")}>\n <MotionCard className={cn(\"card-base group relative\", className)}>\n {settingsHref && (\n <Link\n href={settingsHref}\n onClick={(e) => e.stopPropagation()}\n className=\"absolute top-2 right-2 z-10 min-h-11 min-w-11 rounded-full flex items-center justify-center\"\n aria-label=\"Collection settings\"\n >\n <span className=\"flex h-7 w-7 items-center justify-center rounded-full bg-black/40 backdrop-blur-sm text-white/70 hover:text-white hover:bg-black/60 transition-colors\">\n <Settings2 className=\"h-3.5 w-3.5\" />\n </span>\n </Link>\n )}\n\n <Link href={href ?? `/collections/${collection.contractAddress}`} className=\"block relative h-full\">\n <div className=\"relative aspect-square w-full overflow-hidden bg-muted\">\n {showImage ? (\n <Image\n src={imageUrl}\n alt={collection.name ?? \"Collection\"}\n fill\n className=\"object-cover transition-transform duration-500 group-hover:scale-105\"\n onError={() => setImgError(true)}\n unoptimized\n />\n ) : (\n <div className=\"absolute inset-0 bg-gradient-to-br from-brand-purple/30 via-brand-blue/20 to-brand-navy/40 flex items-center justify-center\">\n <span className=\"text-8xl font-black text-white/10 select-none tracking-tighter\">\n {initial}\n </span>\n </div>\n )}\n\n <div className=\"absolute bottom-0 left-0 right-0 px-3 pb-3 flex flex-col gap-1.5 items-start\">\n {!collection.name && collection.metadataStatus === \"PENDING\" ? (\n <span className=\"flex items-center gap-1 text-2xs text-white/60 backdrop-blur-md bg-black/30 rounded-full px-2 py-0.5\">\n <Loader2 className=\"h-2.5 w-2.5 animate-spin\" />\n Indexing…\n </span>\n ) : (\n <p\n className=\"font-bold text-sm text-white leading-tight backdrop-blur-md bg-black/30 rounded-lg px-2.5 py-1 max-w-full truncate\"\n style={{ textShadow: \"0 1px 6px rgba(0,0,0,0.5)\" }}\n >\n {collection.name ?? \"Unnamed Collection\"}\n </p>\n )}\n\n <div className=\"flex items-center gap-1.5 flex-wrap\">\n {collection.totalSupply != null && (\n <span className=\"text-2xs font-medium text-white/80 backdrop-blur-md bg-black/30 rounded-full px-2 py-0.5\">\n {collection.totalSupply.toLocaleString()} items\n </span>\n )}\n {floor && (\n <span className=\"inline-flex items-center gap-1 text-2xs font-bold text-white/90 backdrop-blur-md bg-black/30 rounded-full px-2 py-0.5\">\n Floor\n <CurrencyIcon symbol={floor.symbol} size={10} />\n {floor.amount}\n </span>\n )}\n {hasExclusiveContent && (\n <span className=\"inline-flex items-center gap-1 text-2xs font-bold text-white backdrop-blur-md bg-black/50 rounded-full px-2 py-0.5\">\n ✦ Exclusive\n </span>\n )}\n </div>\n </div>\n </div>\n </Link>\n </MotionCard>\n </div>\n );\n}\n\nexport function CollectionCardSkeleton() {\n return (\n <div className=\"card-base overflow-hidden\">\n <div className=\"relative aspect-square w-full overflow-hidden bg-muted\">\n <div className=\"absolute inset-0 animate-pulse bg-muted\" />\n <div className=\"absolute bottom-3 left-3 right-3 space-y-1.5\">\n <div className=\"h-4 w-2/3 rounded-md bg-muted-foreground/20 animate-pulse\" />\n <div className=\"h-3 w-1/3 rounded-md bg-muted-foreground/20 animate-pulse\" />\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;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DAAC,SAAI,WAAU,6DAA4D;AAAA,MAC3E,4CAAC,SAAI,WAAU,6DAA4D;AAAA,OAC7E;AAAA,KACF,GACF;AAEJ;","names":["Link","Image"]}
|
|
@@ -5,10 +5,10 @@ import Link from "./link.js";
|
|
|
5
5
|
import Image from "./image.js";
|
|
6
6
|
import { Loader2, Settings2 } from "lucide-react";
|
|
7
7
|
import { cn } from "../utils/cn.js";
|
|
8
|
-
import { ipfsToHttp } from "../utils/ipfs.js";
|
|
9
8
|
import { formatDisplayPrice } from "../utils/format.js";
|
|
10
9
|
import { MotionCard } from "./motion-primitives.js";
|
|
11
10
|
import { CurrencyIcon } from "./currency-icon.js";
|
|
11
|
+
import { useImageUrl } from "../utils/use-image-url.js";
|
|
12
12
|
function parseFloorPrice(floor) {
|
|
13
13
|
if (!floor) return null;
|
|
14
14
|
const formatted = formatDisplayPrice(floor);
|
|
@@ -19,8 +19,9 @@ function parseFloorPrice(floor) {
|
|
|
19
19
|
return { amount, symbol };
|
|
20
20
|
}
|
|
21
21
|
function CollectionCard({ collection, href, settingsHref, className }) {
|
|
22
|
+
const resolveImage = useImageUrl();
|
|
22
23
|
const [imgError, setImgError] = useState(false);
|
|
23
|
-
const imageUrl =
|
|
24
|
+
const imageUrl = resolveImage(collection.image, { width: 480 });
|
|
24
25
|
const showImage = imageUrl && !imgError;
|
|
25
26
|
const initial = (collection.name ?? collection.contractAddress).charAt(0).toUpperCase();
|
|
26
27
|
const floor = parseFloorPrice(collection.floorPrice);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/collection-card.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport Link from \"./link.js\";\nimport Image from \"./image.js\";\nimport { Loader2, Settings2 } from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/components/collection-card.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport Link from \"./link.js\";\nimport Image from \"./image.js\";\nimport { Loader2, Settings2 } from \"lucide-react\";\nimport { cn } from \"../utils/cn.js\";\nimport { formatDisplayPrice } from \"../utils/format.js\";\nimport { MotionCard } from \"./motion-primitives.js\";\nimport { CurrencyIcon } from \"./currency-icon.js\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\n\nfunction parseFloorPrice(floor: string | null | undefined): { amount: string; symbol: string } | null {\n if (!floor) return null;\n const formatted = formatDisplayPrice(floor);\n const parts = formatted.trim().split(/\\s+/);\n if (parts.length < 2) return null;\n const symbol = parts[parts.length - 1];\n const amount = parts.slice(0, -1).join(\" \");\n return { amount, symbol };\n}\n\ntype CollectionWithProfile = ApiCollection & {\n profile?: { hasGatedContent?: boolean } | null;\n};\n\nexport interface CollectionCardProps {\n collection: ApiCollection;\n\n href?: string;\n\n settingsHref?: string;\n className?: string;\n}\n\nexport function CollectionCard({ collection, href, settingsHref, className }: CollectionCardProps) {\n const resolveImage = useImageUrl();\n const [imgError, setImgError] = useState(false);\n const imageUrl = resolveImage(collection.image, { width: 480 });\n const showImage = imageUrl && !imgError;\n const initial = (collection.name ?? collection.contractAddress).charAt(0).toUpperCase();\n const floor = parseFloorPrice(collection.floorPrice);\n const hasExclusiveContent = !!(collection as CollectionWithProfile).profile?.hasGatedContent;\n\n return (\n <div className={cn(hasExclusiveContent && \"card-exclusive-wrapper btn-border-animated\")}>\n <MotionCard className={cn(\"card-base group relative\", className)}>\n {settingsHref && (\n <Link\n href={settingsHref}\n onClick={(e) => e.stopPropagation()}\n className=\"absolute top-2 right-2 z-10 min-h-11 min-w-11 rounded-full flex items-center justify-center\"\n aria-label=\"Collection settings\"\n >\n <span className=\"flex h-7 w-7 items-center justify-center rounded-full bg-black/40 backdrop-blur-sm text-white/70 hover:text-white hover:bg-black/60 transition-colors\">\n <Settings2 className=\"h-3.5 w-3.5\" />\n </span>\n </Link>\n )}\n\n <Link href={href ?? `/collections/${collection.contractAddress}`} className=\"block relative h-full\">\n <div className=\"relative aspect-square w-full overflow-hidden bg-muted\">\n {showImage ? (\n <Image\n src={imageUrl}\n alt={collection.name ?? \"Collection\"}\n fill\n className=\"object-cover transition-transform duration-500 group-hover:scale-105\"\n onError={() => setImgError(true)}\n unoptimized\n />\n ) : (\n <div className=\"absolute inset-0 bg-gradient-to-br from-brand-purple/30 via-brand-blue/20 to-brand-navy/40 flex items-center justify-center\">\n <span className=\"text-8xl font-black text-white/10 select-none tracking-tighter\">\n {initial}\n </span>\n </div>\n )}\n\n <div className=\"absolute bottom-0 left-0 right-0 px-3 pb-3 flex flex-col gap-1.5 items-start\">\n {!collection.name && collection.metadataStatus === \"PENDING\" ? (\n <span className=\"flex items-center gap-1 text-2xs text-white/60 backdrop-blur-md bg-black/30 rounded-full px-2 py-0.5\">\n <Loader2 className=\"h-2.5 w-2.5 animate-spin\" />\n Indexing…\n </span>\n ) : (\n <p\n className=\"font-bold text-sm text-white leading-tight backdrop-blur-md bg-black/30 rounded-lg px-2.5 py-1 max-w-full truncate\"\n style={{ textShadow: \"0 1px 6px rgba(0,0,0,0.5)\" }}\n >\n {collection.name ?? \"Unnamed Collection\"}\n </p>\n )}\n\n <div className=\"flex items-center gap-1.5 flex-wrap\">\n {collection.totalSupply != null && (\n <span className=\"text-2xs font-medium text-white/80 backdrop-blur-md bg-black/30 rounded-full px-2 py-0.5\">\n {collection.totalSupply.toLocaleString()} items\n </span>\n )}\n {floor && (\n <span className=\"inline-flex items-center gap-1 text-2xs font-bold text-white/90 backdrop-blur-md bg-black/30 rounded-full px-2 py-0.5\">\n Floor\n <CurrencyIcon symbol={floor.symbol} size={10} />\n {floor.amount}\n </span>\n )}\n {hasExclusiveContent && (\n <span className=\"inline-flex items-center gap-1 text-2xs font-bold text-white backdrop-blur-md bg-black/50 rounded-full px-2 py-0.5\">\n ✦ Exclusive\n </span>\n )}\n </div>\n </div>\n </div>\n </Link>\n </MotionCard>\n </div>\n );\n}\n\nexport function CollectionCardSkeleton() {\n return (\n <div className=\"card-base overflow-hidden\">\n <div className=\"relative aspect-square w-full overflow-hidden bg-muted\">\n <div className=\"absolute inset-0 animate-pulse bg-muted\" />\n <div className=\"absolute bottom-3 left-3 right-3 space-y-1.5\">\n <div className=\"h-4 w-2/3 rounded-md bg-muted-foreground/20 animate-pulse\" />\n <div className=\"h-3 w-1/3 rounded-md bg-muted-foreground/20 animate-pulse\" />\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";AAwDc,cA0BE,YA1BF;AAtDd,SAAS,gBAAgB;AACzB,OAAO,UAAU;AACjB,OAAO,WAAW;AAClB,SAAS,SAAS,iBAAiB;AACnC,SAAS,UAAU;AACnB,SAAS,0BAA0B;AACnC,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB;AAE7B,SAAS,mBAAmB;AAE5B,SAAS,gBAAgB,OAA6E;AACpG,MAAI,CAAC,MAAO,QAAO;AACnB,QAAM,YAAY,mBAAmB,KAAK;AAC1C,QAAM,QAAQ,UAAU,KAAK,EAAE,MAAM,KAAK;AAC1C,MAAI,MAAM,SAAS,EAAG,QAAO;AAC7B,QAAM,SAAS,MAAM,MAAM,SAAS,CAAC;AACrC,QAAM,SAAS,MAAM,MAAM,GAAG,EAAE,EAAE,KAAK,GAAG;AAC1C,SAAO,EAAE,QAAQ,OAAO;AAC1B;AAeO,SAAS,eAAe,EAAE,YAAY,MAAM,cAAc,UAAU,GAAwB;AACjG,QAAM,eAAe,YAAY;AACjC,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAC9C,QAAM,WAAW,aAAa,WAAW,OAAO,EAAE,OAAO,IAAI,CAAC;AAC9D,QAAM,YAAY,YAAY,CAAC;AAC/B,QAAM,WAAW,WAAW,QAAQ,WAAW,iBAAiB,OAAO,CAAC,EAAE,YAAY;AACtF,QAAM,QAAQ,gBAAgB,WAAW,UAAU;AACnD,QAAM,sBAAsB,CAAC,CAAE,WAAqC,SAAS;AAE7E,SACE,oBAAC,SAAI,WAAW,GAAG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C,UAAK,WAAU,sHAAqH,8BAErI;AAAA,WAEJ;AAAA,SACF;AAAA,OACF,GACF;AAAA,KACF,GACF;AAEJ;AAEO,SAAS,yBAAyB;AACvC,SACE,oBAAC,SAAI,WAAU,6BACb,+BAAC,SAAI,WAAU,0DACb;AAAA,wBAAC,SAAI,WAAU,2CAA0C;AAAA,IACzD,qBAAC,SAAI,WAAU,gDACb;AAAA,0BAAC,SAAI,WAAU,6DAA4D;AAAA,MAC3E,oBAAC,SAAI,WAAU,6DAA4D;AAAA,OAC7E;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
@@ -30,9 +30,9 @@ var import_asset_utility_icons = require("./asset-utility-icons.js");
|
|
|
30
30
|
var import_address_display = require("./address-display.js");
|
|
31
31
|
var import_creator_chip = require("./creator-chip.js");
|
|
32
32
|
var import_currency_icon = require("./currency-icon.js");
|
|
33
|
-
var import_ipfs = require("../utils/ipfs.js");
|
|
34
33
|
var import_format = require("../utils/format.js");
|
|
35
34
|
var import_explorer_url = require("../utils/explorer-url.js");
|
|
35
|
+
var import_use_image_url = require("../utils/use-image-url.js");
|
|
36
36
|
const CHIP = "text-2xs font-semibold px-2.5 py-1 rounded-full bg-muted text-muted-foreground";
|
|
37
37
|
function PriceStat({ label, raw }) {
|
|
38
38
|
const { numStr, symbol } = (0, import_format.parsePriceDisplay)(raw);
|
|
@@ -40,7 +40,8 @@ function PriceStat({ label, raw }) {
|
|
|
40
40
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_media_header.HeaderStat, { label, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_currency_icon.CurrencyAmount, { amount: numStr, symbol, iconSize: 12 }) });
|
|
41
41
|
}
|
|
42
42
|
function CollectionHeader({ collection, loading = false, onReportClick, children }) {
|
|
43
|
-
const
|
|
43
|
+
const resolveImage = (0, import_use_image_url.useImageUrl)();
|
|
44
|
+
const image = resolveImage(collection?.image);
|
|
44
45
|
const name = collection?.name ?? "Unnamed Collection";
|
|
45
46
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_media_header.MediaHeader, { image, imageAlt: name, fallbackIcon: import_lucide_react.Layers, loading: loading || !collection, children: collection ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
46
47
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/collection-header.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Layers } from \"lucide-react\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport { AssetHeaderBlock } from \"./asset-top-sections.js\";\nimport { MediaHeader, HeaderStats, HeaderStat } from \"./media-header.js\";\nimport { AssetUtilityIcons } from \"./asset-utility-icons.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { CreatorChip } from \"./creator-chip.js\";\nimport { CurrencyAmount } from \"./currency-icon.js\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/components/collection-header.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Layers } from \"lucide-react\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport { AssetHeaderBlock } from \"./asset-top-sections.js\";\nimport { MediaHeader, HeaderStats, HeaderStat } from \"./media-header.js\";\nimport { AssetUtilityIcons } from \"./asset-utility-icons.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { CreatorChip } from \"./creator-chip.js\";\nimport { CurrencyAmount } from \"./currency-icon.js\";\nimport { parsePriceDisplay } from \"../utils/format.js\";\nimport { EXPLORER_URL } from \"../utils/explorer-url.js\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\n\nconst CHIP = \"text-2xs font-semibold px-2.5 py-1 rounded-full bg-muted text-muted-foreground\";\n\nexport interface CollectionHeaderProps {\n collection: ApiCollection | null | undefined;\n loading?: boolean;\n onReportClick: () => void;\n children?: ReactNode;\n}\n\nfunction PriceStat({ label, raw }: { label: string; raw: string | null }) {\n const { numStr, symbol } = parsePriceDisplay(raw);\n if (!symbol || numStr === \"—\") return null;\n return (\n <HeaderStat label={label}>\n <CurrencyAmount amount={numStr} symbol={symbol} iconSize={12} />\n </HeaderStat>\n );\n}\n\nexport function CollectionHeader({ collection, loading = false, onReportClick, children }: CollectionHeaderProps) {\n const resolveImage = useImageUrl();\n const image = resolveImage(collection?.image);\n const name = collection?.name ?? \"Unnamed Collection\";\n\n return (\n <MediaHeader image={image} imageAlt={name} fallbackIcon={Layers} loading={loading || !collection}>\n {collection ? (\n <>\n <AssetHeaderBlock\n name={name}\n description={collection.description}\n badges={(\n <>\n <span className={CHIP}>{collection.standard === \"ERC1155\" ? \"Multi-edition\" : \"Single NFT\"}</span>\n {collection.symbol ? <span className={CHIP}>{collection.symbol}</span> : null}\n </>\n )}\n />\n\n <HeaderStats>\n {collection.totalSupply != null ? <HeaderStat label=\"Items\">{collection.totalSupply.toLocaleString()}</HeaderStat> : null}\n {collection.holderCount != null ? <HeaderStat label=\"Holders\">{collection.holderCount.toLocaleString()}</HeaderStat> : null}\n <PriceStat label=\"Floor\" raw={collection.floorPrice} />\n <PriceStat label=\"Volume\" raw={collection.totalVolume} />\n </HeaderStats>\n\n <div className=\"flex flex-wrap items-center gap-2\">\n {collection.owner ? <CreatorChip address={collection.owner} /> : null}\n <AddressDisplay address={collection.contractAddress} chars={6} className=\"text-xs text-muted-foreground\" />\n </div>\n\n <div className=\"-ml-3\">\n <AssetUtilityIcons\n contractExplorerHref={`${EXPLORER_URL}/contract/${collection.contractAddress}`}\n shareTitle={name}\n onReportClick={onReportClick}\n />\n </div>\n\n {children}\n </>\n ) : null}\n </MediaHeader>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA6BM;AA1BN,0BAAuB;AAEvB,gCAAiC;AACjC,0BAAqD;AACrD,iCAAkC;AAClC,6BAA+B;AAC/B,0BAA4B;AAC5B,2BAA+B;AAC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CAAe,SAAS,WAAW,iBAAiB,OAAO,GAAG,WAAU,iCAAgC;AAAA,OAC3G;AAAA,IAEA,4CAAC,SAAI,WAAU,SACb;AAAA,MAAC;AAAA;AAAA,QACC,sBAAsB,GAAG,gCAAY,aAAa,WAAW,eAAe;AAAA,QAC5E,YAAY;AAAA,QACZ;AAAA;AAAA,IACF,GACF;AAAA,IAEC;AAAA,KACH,IACE,MACN;AAEJ;","names":[]}
|
|
@@ -7,9 +7,9 @@ import { AssetUtilityIcons } from "./asset-utility-icons.js";
|
|
|
7
7
|
import { AddressDisplay } from "./address-display.js";
|
|
8
8
|
import { CreatorChip } from "./creator-chip.js";
|
|
9
9
|
import { CurrencyAmount } from "./currency-icon.js";
|
|
10
|
-
import { ipfsToHttp } from "../utils/ipfs.js";
|
|
11
10
|
import { parsePriceDisplay } from "../utils/format.js";
|
|
12
11
|
import { EXPLORER_URL } from "../utils/explorer-url.js";
|
|
12
|
+
import { useImageUrl } from "../utils/use-image-url.js";
|
|
13
13
|
const CHIP = "text-2xs font-semibold px-2.5 py-1 rounded-full bg-muted text-muted-foreground";
|
|
14
14
|
function PriceStat({ label, raw }) {
|
|
15
15
|
const { numStr, symbol } = parsePriceDisplay(raw);
|
|
@@ -17,7 +17,8 @@ function PriceStat({ label, raw }) {
|
|
|
17
17
|
return /* @__PURE__ */ jsx(HeaderStat, { label, children: /* @__PURE__ */ jsx(CurrencyAmount, { amount: numStr, symbol, iconSize: 12 }) });
|
|
18
18
|
}
|
|
19
19
|
function CollectionHeader({ collection, loading = false, onReportClick, children }) {
|
|
20
|
-
const
|
|
20
|
+
const resolveImage = useImageUrl();
|
|
21
|
+
const image = resolveImage(collection?.image);
|
|
21
22
|
const name = collection?.name ?? "Unnamed Collection";
|
|
22
23
|
return /* @__PURE__ */ jsx(MediaHeader, { image, imageAlt: name, fallbackIcon: Layers, loading: loading || !collection, children: collection ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
23
24
|
/* @__PURE__ */ jsx(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/collection-header.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Layers } from \"lucide-react\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport { AssetHeaderBlock } from \"./asset-top-sections.js\";\nimport { MediaHeader, HeaderStats, HeaderStat } from \"./media-header.js\";\nimport { AssetUtilityIcons } from \"./asset-utility-icons.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { CreatorChip } from \"./creator-chip.js\";\nimport { CurrencyAmount } from \"./currency-icon.js\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/components/collection-header.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Layers } from \"lucide-react\";\nimport type { ApiCollection } from \"@medialane/sdk\";\nimport { AssetHeaderBlock } from \"./asset-top-sections.js\";\nimport { MediaHeader, HeaderStats, HeaderStat } from \"./media-header.js\";\nimport { AssetUtilityIcons } from \"./asset-utility-icons.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { CreatorChip } from \"./creator-chip.js\";\nimport { CurrencyAmount } from \"./currency-icon.js\";\nimport { parsePriceDisplay } from \"../utils/format.js\";\nimport { EXPLORER_URL } from \"../utils/explorer-url.js\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\n\nconst CHIP = \"text-2xs font-semibold px-2.5 py-1 rounded-full bg-muted text-muted-foreground\";\n\nexport interface CollectionHeaderProps {\n collection: ApiCollection | null | undefined;\n loading?: boolean;\n onReportClick: () => void;\n children?: ReactNode;\n}\n\nfunction PriceStat({ label, raw }: { label: string; raw: string | null }) {\n const { numStr, symbol } = parsePriceDisplay(raw);\n if (!symbol || numStr === \"—\") return null;\n return (\n <HeaderStat label={label}>\n <CurrencyAmount amount={numStr} symbol={symbol} iconSize={12} />\n </HeaderStat>\n );\n}\n\nexport function CollectionHeader({ collection, loading = false, onReportClick, children }: CollectionHeaderProps) {\n const resolveImage = useImageUrl();\n const image = resolveImage(collection?.image);\n const name = collection?.name ?? \"Unnamed Collection\";\n\n return (\n <MediaHeader image={image} imageAlt={name} fallbackIcon={Layers} loading={loading || !collection}>\n {collection ? (\n <>\n <AssetHeaderBlock\n name={name}\n description={collection.description}\n badges={(\n <>\n <span className={CHIP}>{collection.standard === \"ERC1155\" ? \"Multi-edition\" : \"Single NFT\"}</span>\n {collection.symbol ? <span className={CHIP}>{collection.symbol}</span> : null}\n </>\n )}\n />\n\n <HeaderStats>\n {collection.totalSupply != null ? <HeaderStat label=\"Items\">{collection.totalSupply.toLocaleString()}</HeaderStat> : null}\n {collection.holderCount != null ? <HeaderStat label=\"Holders\">{collection.holderCount.toLocaleString()}</HeaderStat> : null}\n <PriceStat label=\"Floor\" raw={collection.floorPrice} />\n <PriceStat label=\"Volume\" raw={collection.totalVolume} />\n </HeaderStats>\n\n <div className=\"flex flex-wrap items-center gap-2\">\n {collection.owner ? <CreatorChip address={collection.owner} /> : null}\n <AddressDisplay address={collection.contractAddress} chars={6} className=\"text-xs text-muted-foreground\" />\n </div>\n\n <div className=\"-ml-3\">\n <AssetUtilityIcons\n contractExplorerHref={`${EXPLORER_URL}/contract/${collection.contractAddress}`}\n shareTitle={name}\n onReportClick={onReportClick}\n />\n </div>\n\n {children}\n </>\n ) : null}\n </MediaHeader>\n );\n}\n"],"mappings":";AA6BM,SAkBQ,UAlBR,KAkBQ,YAlBR;AA1BN,SAAS,cAAc;AAEvB,SAAS,wBAAwB;AACjC,SAAS,aAAa,aAAa,kBAAkB;AACrD,SAAS,yBAAyB;AAClC,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAC/B,SAAS,yBAAyB;AAClC,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAE5B,MAAM,OAAO;AASb,SAAS,UAAU,EAAE,OAAO,IAAI,GAA0C;AACxE,QAAM,EAAE,QAAQ,OAAO,IAAI,kBAAkB,GAAG;AAChD,MAAI,CAAC,U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AY;AAAA,QACZ;AAAA;AAAA,IACF,GACF;AAAA,IAEC;AAAA,KACH,IACE,MACN;AAEJ;","names":[]}
|
|
@@ -37,6 +37,7 @@ var import_lucide_react = require("lucide-react");
|
|
|
37
37
|
var import_link = __toESM(require("./link.js"), 1);
|
|
38
38
|
var import_sdk = require("@medialane/sdk");
|
|
39
39
|
var import_explorer_url = require("../utils/explorer-url.js");
|
|
40
|
+
var import_sdk2 = require("@medialane/sdk");
|
|
40
41
|
function CreationRecord({ originalCreator, registeredAt }) {
|
|
41
42
|
const creator = originalCreator ? (0, import_sdk.normalizeAddress)("STARKNET", originalCreator) : "";
|
|
42
43
|
const date = new Date(registeredAt * 1e3);
|
|
@@ -54,7 +55,7 @@ function CreationRecord({ originalCreator, registeredAt }) {
|
|
|
54
55
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("dl", { className: "space-y-2 text-sm", children: [
|
|
55
56
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
56
57
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", { className: "text-muted-foreground", children: "Original creator" }),
|
|
57
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", { className: "tabular-nums", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_link.default, { href:
|
|
58
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", { className: "tabular-nums", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_link.default, { href: (0, import_sdk2.profileHref)({ address: creator }), className: "hover:underline", children: [
|
|
58
59
|
creator.slice(0, 6),
|
|
59
60
|
"\u2026",
|
|
60
61
|
creator.slice(-4)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/creation-record.tsx"],"sourcesContent":["\"use client\";\n\nimport { Award, ExternalLink } from \"lucide-react\";\nimport Link from \"./link.js\";\nimport { normalizeAddress } from \"@medialane/sdk\";\nimport { EXPLORER_URL } from \"../utils/explorer-url.js\";\n\nexport interface CreationRecordProps {\n originalCreator: string;\n registeredAt: number;\n}\n\nexport function CreationRecord({ originalCreator, registeredAt }: CreationRecordProps) {\n const creator = originalCreator ? normalizeAddress(\"STARKNET\", originalCreator) : \"\";\n const date = new Date(registeredAt * 1000);\n const formatted = date.toLocaleDateString(undefined, {\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n });\n\n return (\n <div className=\"rounded-lg bg-amber-500/5 p-4\">\n <div className=\"flex items-center gap-2 mb-3\">\n <Award className=\"h-4 w-4 text-amber-500\" />\n <p className=\"text-sm font-semibold text-amber-500\">Creation Record</p>\n </div>\n <p className=\"text-xs text-muted-foreground mb-3\">\n Immutable on-chain authorship record set at mint and stored permanently\n for legal evidence of creation (Berne Convention).\n </p>\n <dl className=\"space-y-2 text-sm\">\n <div className=\"flex items-center justify-between\">\n <dt className=\"text-muted-foreground\">Original creator</dt>\n <dd className=\"tabular-nums\">\n <Link href={
|
|
1
|
+
{"version":3,"sources":["../../src/components/creation-record.tsx"],"sourcesContent":["\"use client\";\n\nimport { Award, ExternalLink } from \"lucide-react\";\nimport Link from \"./link.js\";\nimport { normalizeAddress } from \"@medialane/sdk\";\nimport { EXPLORER_URL } from \"../utils/explorer-url.js\";\nimport { profileHref } from \"@medialane/sdk\";\n\nexport interface CreationRecordProps {\n originalCreator: string;\n registeredAt: number;\n}\n\nexport function CreationRecord({ originalCreator, registeredAt }: CreationRecordProps) {\n const creator = originalCreator ? normalizeAddress(\"STARKNET\", originalCreator) : \"\";\n const date = new Date(registeredAt * 1000);\n const formatted = date.toLocaleDateString(undefined, {\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n });\n\n return (\n <div className=\"rounded-lg bg-amber-500/5 p-4\">\n <div className=\"flex items-center gap-2 mb-3\">\n <Award className=\"h-4 w-4 text-amber-500\" />\n <p className=\"text-sm font-semibold text-amber-500\">Creation Record</p>\n </div>\n <p className=\"text-xs text-muted-foreground mb-3\">\n Immutable on-chain authorship record set at mint and stored permanently\n for legal evidence of creation (Berne Convention).\n </p>\n <dl className=\"space-y-2 text-sm\">\n <div className=\"flex items-center justify-between\">\n <dt className=\"text-muted-foreground\">Original creator</dt>\n <dd className=\"tabular-nums\">\n <Link href={profileHref({ address: creator })} className=\"hover:underline\">\n {creator.slice(0, 6)}…{creator.slice(-4)}\n </Link>\n </dd>\n </div>\n <div className=\"flex items-center justify-between\">\n <dt className=\"text-muted-foreground\">Registered at</dt>\n <dd>\n <a\n href={`${EXPLORER_URL}/contract/${creator}`}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"inline-flex items-center gap-1 hover:underline\"\n >\n {formatted}\n <ExternalLink className=\"h-3 w-3\" />\n </a>\n </dd>\n </div>\n </dl>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBM;AAtBN,0BAAoC;AACpC,kBAAiB;AACjB,iBAAiC;AACjC,0BAA6B;AAC7B,IAAAA,cAA4B;AAOrB,SAAS,eAAe,EAAE,iBAAiB,aAAa,GAAwB;AACrF,QAAM,UAAU,sBAAkB,6BAAiB,YAAY,eAAe,IAAI;AAClF,QAAM,OAAO,IAAI,KAAK,eAAe,GAAI;AACzC,QAAM,YAAY,KAAK,mBAAmB,QAAW;AAAA,IACnD,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,EACP,CAAC;AAED,SACE,6CAAC,SAAI,WAAU,iCACb;AAAA,iDAAC,SAAI,WAAU,gCACb;AAAA,kDAAC,6BAAM,WAAU,0BAAyB;AAAA,MAC1C,4CAAC,OAAE,WAAU,wCAAuC,6BAAe;AAAA,OACrE;AAAA,IACA,4CAAC,OAAE,WAAU,sCAAqC,wIAGlD;AAAA,IACA,6CAAC,QAAG,WAAU,qBACZ;AAAA,mDAAC,SAAI,WAAU,qCACb;AAAA,oDAAC,QAAG,WAAU,yBAAwB,8BAAgB;AAAA,QACtD,4CAAC,QAAG,WAAU,gBACZ,uDAAC,YAAAC,SAAA,EAAK,UAAM,yBAAY,EAAE,SAAS,QAAQ,CAAC,GAAG,WAAU,mBACtD;AAAA,kBAAQ,MAAM,GAAG,CAAC;AAAA,UAAE;AAAA,UAAE,QAAQ,MAAM,EAAE;AAAA,WACzC,GACF;AAAA,SACF;AAAA,MACA,6CAAC,SAAI,WAAU,qCACb;AAAA,oDAAC,QAAG,WAAU,yBAAwB,2BAAa;AAAA,QACnD,4CAAC,QACC;AAAA,UAAC;AAAA;AAAA,YACC,MAAM,GAAG,gCAAY,aAAa,OAAO;AAAA,YACzC,QAAO;AAAA,YACP,KAAI;AAAA,YACJ,WAAU;AAAA,YAET;AAAA;AAAA,cACD,4CAAC,oCAAa,WAAU,WAAU;AAAA;AAAA;AAAA,QACpC,GACF;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAEJ;","names":["import_sdk","Link"]}
|
|
@@ -4,6 +4,7 @@ import { Award, ExternalLink } from "lucide-react";
|
|
|
4
4
|
import Link from "./link.js";
|
|
5
5
|
import { normalizeAddress } from "@medialane/sdk";
|
|
6
6
|
import { EXPLORER_URL } from "../utils/explorer-url.js";
|
|
7
|
+
import { profileHref } from "@medialane/sdk";
|
|
7
8
|
function CreationRecord({ originalCreator, registeredAt }) {
|
|
8
9
|
const creator = originalCreator ? normalizeAddress("STARKNET", originalCreator) : "";
|
|
9
10
|
const date = new Date(registeredAt * 1e3);
|
|
@@ -21,7 +22,7 @@ function CreationRecord({ originalCreator, registeredAt }) {
|
|
|
21
22
|
/* @__PURE__ */ jsxs("dl", { className: "space-y-2 text-sm", children: [
|
|
22
23
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
23
24
|
/* @__PURE__ */ jsx("dt", { className: "text-muted-foreground", children: "Original creator" }),
|
|
24
|
-
/* @__PURE__ */ jsx("dd", { className: "tabular-nums", children: /* @__PURE__ */ jsxs(Link, { href:
|
|
25
|
+
/* @__PURE__ */ jsx("dd", { className: "tabular-nums", children: /* @__PURE__ */ jsxs(Link, { href: profileHref({ address: creator }), className: "hover:underline", children: [
|
|
25
26
|
creator.slice(0, 6),
|
|
26
27
|
"\u2026",
|
|
27
28
|
creator.slice(-4)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/creation-record.tsx"],"sourcesContent":["\"use client\";\n\nimport { Award, ExternalLink } from \"lucide-react\";\nimport Link from \"./link.js\";\nimport { normalizeAddress } from \"@medialane/sdk\";\nimport { EXPLORER_URL } from \"../utils/explorer-url.js\";\n\nexport interface CreationRecordProps {\n originalCreator: string;\n registeredAt: number;\n}\n\nexport function CreationRecord({ originalCreator, registeredAt }: CreationRecordProps) {\n const creator = originalCreator ? normalizeAddress(\"STARKNET\", originalCreator) : \"\";\n const date = new Date(registeredAt * 1000);\n const formatted = date.toLocaleDateString(undefined, {\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n });\n\n return (\n <div className=\"rounded-lg bg-amber-500/5 p-4\">\n <div className=\"flex items-center gap-2 mb-3\">\n <Award className=\"h-4 w-4 text-amber-500\" />\n <p className=\"text-sm font-semibold text-amber-500\">Creation Record</p>\n </div>\n <p className=\"text-xs text-muted-foreground mb-3\">\n Immutable on-chain authorship record set at mint and stored permanently\n for legal evidence of creation (Berne Convention).\n </p>\n <dl className=\"space-y-2 text-sm\">\n <div className=\"flex items-center justify-between\">\n <dt className=\"text-muted-foreground\">Original creator</dt>\n <dd className=\"tabular-nums\">\n <Link href={
|
|
1
|
+
{"version":3,"sources":["../../src/components/creation-record.tsx"],"sourcesContent":["\"use client\";\n\nimport { Award, ExternalLink } from \"lucide-react\";\nimport Link from \"./link.js\";\nimport { normalizeAddress } from \"@medialane/sdk\";\nimport { EXPLORER_URL } from \"../utils/explorer-url.js\";\nimport { profileHref } from \"@medialane/sdk\";\n\nexport interface CreationRecordProps {\n originalCreator: string;\n registeredAt: number;\n}\n\nexport function CreationRecord({ originalCreator, registeredAt }: CreationRecordProps) {\n const creator = originalCreator ? normalizeAddress(\"STARKNET\", originalCreator) : \"\";\n const date = new Date(registeredAt * 1000);\n const formatted = date.toLocaleDateString(undefined, {\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n });\n\n return (\n <div className=\"rounded-lg bg-amber-500/5 p-4\">\n <div className=\"flex items-center gap-2 mb-3\">\n <Award className=\"h-4 w-4 text-amber-500\" />\n <p className=\"text-sm font-semibold text-amber-500\">Creation Record</p>\n </div>\n <p className=\"text-xs text-muted-foreground mb-3\">\n Immutable on-chain authorship record set at mint and stored permanently\n for legal evidence of creation (Berne Convention).\n </p>\n <dl className=\"space-y-2 text-sm\">\n <div className=\"flex items-center justify-between\">\n <dt className=\"text-muted-foreground\">Original creator</dt>\n <dd className=\"tabular-nums\">\n <Link href={profileHref({ address: creator })} className=\"hover:underline\">\n {creator.slice(0, 6)}…{creator.slice(-4)}\n </Link>\n </dd>\n </div>\n <div className=\"flex items-center justify-between\">\n <dt className=\"text-muted-foreground\">Registered at</dt>\n <dd>\n <a\n href={`${EXPLORER_URL}/contract/${creator}`}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"inline-flex items-center gap-1 hover:underline\"\n >\n {formatted}\n <ExternalLink className=\"h-3 w-3\" />\n </a>\n </dd>\n </div>\n </dl>\n </div>\n );\n}\n"],"mappings":";AAwBM,SACE,KADF;AAtBN,SAAS,OAAO,oBAAoB;AACpC,OAAO,UAAU;AACjB,SAAS,wBAAwB;AACjC,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAOrB,SAAS,eAAe,EAAE,iBAAiB,aAAa,GAAwB;AACrF,QAAM,UAAU,kBAAkB,iBAAiB,YAAY,eAAe,IAAI;AAClF,QAAM,OAAO,IAAI,KAAK,eAAe,GAAI;AACzC,QAAM,YAAY,KAAK,mBAAmB,QAAW;AAAA,IACnD,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,EACP,CAAC;AAED,SACE,qBAAC,SAAI,WAAU,iCACb;AAAA,yBAAC,SAAI,WAAU,gCACb;AAAA,0BAAC,SAAM,WAAU,0BAAyB;AAAA,MAC1C,oBAAC,OAAE,WAAU,wCAAuC,6BAAe;AAAA,OACrE;AAAA,IACA,oBAAC,OAAE,WAAU,sCAAqC,wIAGlD;AAAA,IACA,qBAAC,QAAG,WAAU,qBACZ;AAAA,2BAAC,SAAI,WAAU,qCACb;AAAA,4BAAC,QAAG,WAAU,yBAAwB,8BAAgB;AAAA,QACtD,oBAAC,QAAG,WAAU,gBACZ,+BAAC,QAAK,MAAM,YAAY,EAAE,SAAS,QAAQ,CAAC,GAAG,WAAU,mBACtD;AAAA,kBAAQ,MAAM,GAAG,CAAC;AAAA,UAAE;AAAA,UAAE,QAAQ,MAAM,EAAE;AAAA,WACzC,GACF;AAAA,SACF;AAAA,MACA,qBAAC,SAAI,WAAU,qCACb;AAAA,4BAAC,QAAG,WAAU,yBAAwB,2BAAa;AAAA,QACnD,oBAAC,QACC;AAAA,UAAC;AAAA;AAAA,YACC,MAAM,GAAG,YAAY,aAAa,OAAO;AAAA,YACzC,QAAO;AAAA,YACP,KAAI;AAAA,YACJ,WAAU;AAAA,YAET;AAAA;AAAA,cACD,oBAAC,gBAAa,WAAU,WAAU;AAAA;AAAA;AAAA,QACpC,GACF;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -36,13 +36,14 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
36
36
|
var import_link = __toESM(require("./link.js"), 1);
|
|
37
37
|
var import_use_profiles = require("../utils/use-profiles.js");
|
|
38
38
|
var import_address_display = require("./address-display.js");
|
|
39
|
+
var import_sdk = require("@medialane/sdk");
|
|
39
40
|
function CreatorChip({ address }) {
|
|
40
41
|
const { profile } = (0, import_use_profiles.useCreatorProfile)(address);
|
|
41
42
|
const label = profile?.name || profile?.username || null;
|
|
42
43
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
43
44
|
import_link.default,
|
|
44
45
|
{
|
|
45
|
-
href:
|
|
46
|
+
href: (0, import_sdk.profileHref)({ address }),
|
|
46
47
|
className: "inline-flex items-center gap-1.5 text-sm rounded-full px-2 py-1 hover:bg-muted/60 active:scale-[0.98] transition",
|
|
47
48
|
children: [
|
|
48
49
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-muted-foreground shrink-0", children: "by" }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/creator-chip.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport { useCreatorProfile } from \"../utils/use-profiles.js\";\nimport { AddressDisplay } from \"./address-display.js\";\n\nexport interface CreatorChipProps {\n address: string;\n}\n\nexport function CreatorChip({ address }: CreatorChipProps) {\n const { profile } = useCreatorProfile(address);\n const label = profile?.name || profile?.username || null;\n\n return (\n <Link\n href={
|
|
1
|
+
{"version":3,"sources":["../../src/components/creator-chip.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport { useCreatorProfile } from \"../utils/use-profiles.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { profileHref } from \"@medialane/sdk\";\n\nexport interface CreatorChipProps {\n address: string;\n}\n\nexport function CreatorChip({ address }: CreatorChipProps) {\n const { profile } = useCreatorProfile(address);\n const label = profile?.name || profile?.username || null;\n\n return (\n <Link\n href={profileHref({ address })}\n className=\"inline-flex items-center gap-1.5 text-sm rounded-full px-2 py-1 hover:bg-muted/60 active:scale-[0.98] transition\"\n >\n <span className=\"text-muted-foreground shrink-0\">by</span>\n {label ? (\n <span className=\"font-semibold text-foreground truncate\">{label}</span>\n ) : (\n <AddressDisplay address={address} chars={6} showCopy={false} className=\"font-semibold text-foreground\" />\n )}\n </Link>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBI;AAdJ,kBAAiB;AACjB,0BAAkC;AAClC,6BAA+B;AAC/B,iBAA4B;AAMrB,SAAS,YAAY,EAAE,QAAQ,GAAqB;AACzD,QAAM,EAAE,QAAQ,QAAI,uCAAkB,OAAO;AAC7C,QAAM,QAAQ,SAAS,QAAQ,SAAS,YAAY;AAEpD,SACE;AAAA,IAAC,YAAAA;AAAA,IAAA;AAAA,MACC,UAAM,wBAAY,EAAE,QAAQ,CAAC;AAAA,MAC7B,WAAU;AAAA,MAEV;AAAA,oDAAC,UAAK,WAAU,kCAAiC,gBAAE;AAAA,QAClD,QACC,4CAAC,UAAK,WAAU,0CAA0C,iBAAM,IAEhE,4CAAC,yCAAe,SAAkB,OAAO,GAAG,UAAU,OAAO,WAAU,iCAAgC;AAAA;AAAA;AAAA,EAE3G;AAEJ;","names":["Link"]}
|
|
@@ -3,13 +3,14 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import Link from "./link.js";
|
|
4
4
|
import { useCreatorProfile } from "../utils/use-profiles.js";
|
|
5
5
|
import { AddressDisplay } from "./address-display.js";
|
|
6
|
+
import { profileHref } from "@medialane/sdk";
|
|
6
7
|
function CreatorChip({ address }) {
|
|
7
8
|
const { profile } = useCreatorProfile(address);
|
|
8
9
|
const label = profile?.name || profile?.username || null;
|
|
9
10
|
return /* @__PURE__ */ jsxs(
|
|
10
11
|
Link,
|
|
11
12
|
{
|
|
12
|
-
href:
|
|
13
|
+
href: profileHref({ address }),
|
|
13
14
|
className: "inline-flex items-center gap-1.5 text-sm rounded-full px-2 py-1 hover:bg-muted/60 active:scale-[0.98] transition",
|
|
14
15
|
children: [
|
|
15
16
|
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground shrink-0", children: "by" }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/creator-chip.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport { useCreatorProfile } from \"../utils/use-profiles.js\";\nimport { AddressDisplay } from \"./address-display.js\";\n\nexport interface CreatorChipProps {\n address: string;\n}\n\nexport function CreatorChip({ address }: CreatorChipProps) {\n const { profile } = useCreatorProfile(address);\n const label = profile?.name || profile?.username || null;\n\n return (\n <Link\n href={
|
|
1
|
+
{"version":3,"sources":["../../src/components/creator-chip.tsx"],"sourcesContent":["\"use client\";\n\nimport Link from \"./link.js\";\nimport { useCreatorProfile } from \"../utils/use-profiles.js\";\nimport { AddressDisplay } from \"./address-display.js\";\nimport { profileHref } from \"@medialane/sdk\";\n\nexport interface CreatorChipProps {\n address: string;\n}\n\nexport function CreatorChip({ address }: CreatorChipProps) {\n const { profile } = useCreatorProfile(address);\n const label = profile?.name || profile?.username || null;\n\n return (\n <Link\n href={profileHref({ address })}\n className=\"inline-flex items-center gap-1.5 text-sm rounded-full px-2 py-1 hover:bg-muted/60 active:scale-[0.98] transition\"\n >\n <span className=\"text-muted-foreground shrink-0\">by</span>\n {label ? (\n <span className=\"font-semibold text-foreground truncate\">{label}</span>\n ) : (\n <AddressDisplay address={address} chars={6} showCopy={false} className=\"font-semibold text-foreground\" />\n )}\n </Link>\n );\n}\n"],"mappings":";AAgBI,SAIE,KAJF;AAdJ,OAAO,UAAU;AACjB,SAAS,yBAAyB;AAClC,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAMrB,SAAS,YAAY,EAAE,QAAQ,GAAqB;AACzD,QAAM,EAAE,QAAQ,IAAI,kBAAkB,OAAO;AAC7C,QAAM,QAAQ,SAAS,QAAQ,SAAS,YAAY;AAEpD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,YAAY,EAAE,QAAQ,CAAC;AAAA,MAC7B,WAAU;AAAA,MAEV;AAAA,4BAAC,UAAK,WAAU,kCAAiC,gBAAE;AAAA,QAClD,QACC,oBAAC,UAAK,WAAU,0CAA0C,iBAAM,IAEhE,oBAAC,kBAAe,SAAkB,OAAO,GAAG,UAAU,OAAO,WAAU,iCAAgC;AAAA;AAAA;AAAA,EAE3G;AAEJ;","names":[]}
|
|
@@ -26,7 +26,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
26
26
|
var import_react = require("react");
|
|
27
27
|
var import_lucide_react = require("lucide-react");
|
|
28
28
|
var import_motion_primitives = require("./motion-primitives.js");
|
|
29
|
-
var
|
|
29
|
+
var import_use_image_url = require("../utils/use-image-url.js");
|
|
30
30
|
function CreatorChipSkeleton() {
|
|
31
31
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "shrink-0 w-64 aspect-square rounded-xl bg-muted animate-pulse" });
|
|
32
32
|
}
|
|
@@ -34,9 +34,10 @@ function CreatorChip({
|
|
|
34
34
|
creator,
|
|
35
35
|
href
|
|
36
36
|
}) {
|
|
37
|
+
const resolveImage = (0, import_use_image_url.useImageUrl)();
|
|
37
38
|
const [bannerError, setBannerError] = (0, import_react.useState)(false);
|
|
38
39
|
const rawSrc = creator.avatarImage || creator.collectionImage || null;
|
|
39
|
-
const bannerUrl = rawSrc && !bannerError ? (
|
|
40
|
+
const bannerUrl = rawSrc && !bannerError ? resolveImage(rawSrc) : null;
|
|
40
41
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
41
42
|
"a",
|
|
42
43
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/discover-creators-strip.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { Users, ArrowRight } from \"lucide-react\";\nimport { FadeIn } from \"./motion-primitives.js\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/components/discover-creators-strip.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { Users, ArrowRight } from \"lucide-react\";\nimport { FadeIn } from \"./motion-primitives.js\";\nimport type { ApiCreatorProfile } from \"@medialane/sdk\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\n\nexport interface DiscoverCreatorsStripProps {\n creators: ApiCreatorProfile[];\n isLoading: boolean;\n getHref: (creator: ApiCreatorProfile) => string;\n allCreatorsHref?: string;\n sectionLabel?: string;\n title?: string;\n}\n\nfunction CreatorChipSkeleton() {\n return (\n <div className=\"shrink-0 w-64 aspect-square rounded-xl bg-muted animate-pulse\" />\n );\n}\n\nfunction CreatorChip({\n creator,\n href,\n}: {\n creator: ApiCreatorProfile;\n href: string;\n}) {\n const resolveImage = useImageUrl();\n const [bannerError, setBannerError] = useState(false);\n\n const rawSrc = creator.avatarImage || creator.collectionImage || null;\n const bannerUrl = rawSrc && !bannerError ? resolveImage(rawSrc) : null;\n\n return (\n <a\n href={href}\n className=\"block shrink-0 w-64 snap-start active:scale-[0.97] transition-transform duration-150 select-none\"\n >\n <div className=\"relative aspect-square rounded-xl overflow-hidden bg-muted\">\n {bannerUrl && (\n <img\n src={bannerUrl}\n alt=\"\"\n aria-hidden\n loading=\"lazy\"\n className=\"absolute inset-0 w-full h-full object-cover\"\n onError={() => setBannerError(true)}\n />\n )}\n <div className=\"absolute bottom-0 inset-x-0 px-3 py-3\">\n <p className=\"font-bold text-2xl text-white truncate\">{creator.username}</p>\n </div>\n </div>\n </a>\n );\n}\n\nexport function DiscoverCreatorsStrip({\n creators,\n isLoading,\n getHref,\n allCreatorsHref = \"/creators\",\n sectionLabel = \"Explore\",\n title = \"Creators\",\n}: DiscoverCreatorsStripProps) {\n if (!isLoading && creators.length === 0) return null;\n\n return (\n <FadeIn>\n <div className=\"space-y-3\">\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"section-label\">{sectionLabel}</p>\n <div className=\"flex items-center gap-2 mt-0.5\">\n <Users className=\"h-4 w-4 text-brand-purple\" />\n <h2 className=\"text-lg font-bold\">{title}</h2>\n </div>\n </div>\n <a\n href={allCreatorsHref}\n className=\"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground px-3 py-1.5 rounded-md hover:bg-accent transition-colors\"\n >\n View all <ArrowRight className=\"h-3.5 w-3.5\" />\n </a>\n </div>\n <div className=\"overflow-x-auto scrollbar-hide snap-x snap-mandatory -mx-4 px-4 md:mx-0 md:px-0\">\n <div className=\"flex gap-5 sm:gap-6 w-max pb-2\">\n {isLoading\n ? Array.from({ length: 6 }).map((_, i) => <CreatorChipSkeleton key={i} />)\n : creators.map((c) => (\n <CreatorChip key={c.walletAddress} creator={c} href={getHref(c)} />\n ))}\n </div>\n </div>\n </div>\n </FadeIn>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBI;AAjBJ,mBAAyB;AACzB,0BAAkC;AAClC,+BAAuB;AAEvB,2BAA4B;AAW5B,SAAS,sBAAsB;AAC7B,SACE,4CAAC,SAAI,WAAU,iEAAgE;AAEnF;AAEA,SAAS,YAAY;AAAA,EACnB;AAAA,EACA;AACF,GAGG;AACD,QAAM,mBAAe,kCAAY;AACjC,QAAM,CAAC,aAAa,cAAc,QAAI,uBAAS,KAAK;AAEpD,QAAM,SAAS,QAAQ,eAAe,QAAQ,mBAAmB;AACjE,QAAM,YAAY,UAAU,CAAC,cAAc,aAAa,MAAM,IAAI;AAElE,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAU;AAAA,MAEV,uDAAC,SAAI,WAAU,8DACZ;AAAA,qBACC;AAAA,UAAC;AAAA;AAAA,YACC,KAAK;AAAA,YACL,KAAI;AAAA,YACJ,eAAW;AAAA,YACX,SAAQ;AAAA,YACR,WAAU;AAAA,YACV,SAAS,MAAM,eAAe,IAAI;AAAA;AAAA,QACpC;AAAA,QAEF,4CAAC,SAAI,WAAU,yCACb,sDAAC,OAAE,WAAU,0CAA0C,kBAAQ,UAAS,GAC1E;AAAA,SACF;AAAA;AAAA,EACF;AAEJ;AAEO,SAAS,sBAAsB;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA,kBAAkB;AAAA,EAClB,eAAe;AAAA,EACf,QAAQ;AACV,GAA+B;AAC7B,MAAI,CAAC,aAAa,SAAS,WAAW,EAAG,QAAO;AAEhD,SACE,4CAAC,mCACC,uDAAC,SAAI,WAAU,aACb;AAAA,iDAAC,SAAI,WAAU,qCACb;AAAA,mDAAC,SACC;AAAA,oDAAC,OAAE,WAAU,iBAAiB,wBAAa;AAAA,QAC3C,6CAAC,SAAI,WAAU,kCACb;AAAA,sDAAC,6BAAM,WAAU,6BAA4B;AAAA,UAC7C,4CAAC,QAAG,WAAU,qBAAqB,iBAAM;AAAA,WAC3C;AAAA,SACF;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,MAAM;AAAA,UACN,WAAU;AAAA,UACX;AAAA;AAAA,YACU,4CAAC,kCAAW,WAAU,eAAc;AAAA;AAAA;AAAA,MAC/C;AAAA,OACF;AAAA,IACA,4CAAC,SAAI,WAAU,mFACb,sDAAC,SAAI,WAAU,kCACZ,sBACG,MAAM,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,MAAM,4CAAC,yBAAyB,CAAG,CAAE,IACvE,SAAS,IAAI,CAAC,MACZ,4CAAC,eAAkC,SAAS,GAAG,MAAM,QAAQ,CAAC,KAA5C,EAAE,aAA6C,CAClE,GACP,GACF;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
@@ -3,7 +3,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { Users, ArrowRight } from "lucide-react";
|
|
5
5
|
import { FadeIn } from "./motion-primitives.js";
|
|
6
|
-
import {
|
|
6
|
+
import { useImageUrl } from "../utils/use-image-url.js";
|
|
7
7
|
function CreatorChipSkeleton() {
|
|
8
8
|
return /* @__PURE__ */ jsx("div", { className: "shrink-0 w-64 aspect-square rounded-xl bg-muted animate-pulse" });
|
|
9
9
|
}
|
|
@@ -11,9 +11,10 @@ function CreatorChip({
|
|
|
11
11
|
creator,
|
|
12
12
|
href
|
|
13
13
|
}) {
|
|
14
|
+
const resolveImage = useImageUrl();
|
|
14
15
|
const [bannerError, setBannerError] = useState(false);
|
|
15
16
|
const rawSrc = creator.avatarImage || creator.collectionImage || null;
|
|
16
|
-
const bannerUrl = rawSrc && !bannerError ?
|
|
17
|
+
const bannerUrl = rawSrc && !bannerError ? resolveImage(rawSrc) : null;
|
|
17
18
|
return /* @__PURE__ */ jsx(
|
|
18
19
|
"a",
|
|
19
20
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/discover-creators-strip.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { Users, ArrowRight } from \"lucide-react\";\nimport { FadeIn } from \"./motion-primitives.js\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/components/discover-creators-strip.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState } from \"react\";\nimport { Users, ArrowRight } from \"lucide-react\";\nimport { FadeIn } from \"./motion-primitives.js\";\nimport type { ApiCreatorProfile } from \"@medialane/sdk\";\nimport { useImageUrl } from \"../utils/use-image-url.js\";\n\nexport interface DiscoverCreatorsStripProps {\n creators: ApiCreatorProfile[];\n isLoading: boolean;\n getHref: (creator: ApiCreatorProfile) => string;\n allCreatorsHref?: string;\n sectionLabel?: string;\n title?: string;\n}\n\nfunction CreatorChipSkeleton() {\n return (\n <div className=\"shrink-0 w-64 aspect-square rounded-xl bg-muted animate-pulse\" />\n );\n}\n\nfunction CreatorChip({\n creator,\n href,\n}: {\n creator: ApiCreatorProfile;\n href: string;\n}) {\n const resolveImage = useImageUrl();\n const [bannerError, setBannerError] = useState(false);\n\n const rawSrc = creator.avatarImage || creator.collectionImage || null;\n const bannerUrl = rawSrc && !bannerError ? resolveImage(rawSrc) : null;\n\n return (\n <a\n href={href}\n className=\"block shrink-0 w-64 snap-start active:scale-[0.97] transition-transform duration-150 select-none\"\n >\n <div className=\"relative aspect-square rounded-xl overflow-hidden bg-muted\">\n {bannerUrl && (\n <img\n src={bannerUrl}\n alt=\"\"\n aria-hidden\n loading=\"lazy\"\n className=\"absolute inset-0 w-full h-full object-cover\"\n onError={() => setBannerError(true)}\n />\n )}\n <div className=\"absolute bottom-0 inset-x-0 px-3 py-3\">\n <p className=\"font-bold text-2xl text-white truncate\">{creator.username}</p>\n </div>\n </div>\n </a>\n );\n}\n\nexport function DiscoverCreatorsStrip({\n creators,\n isLoading,\n getHref,\n allCreatorsHref = \"/creators\",\n sectionLabel = \"Explore\",\n title = \"Creators\",\n}: DiscoverCreatorsStripProps) {\n if (!isLoading && creators.length === 0) return null;\n\n return (\n <FadeIn>\n <div className=\"space-y-3\">\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"section-label\">{sectionLabel}</p>\n <div className=\"flex items-center gap-2 mt-0.5\">\n <Users className=\"h-4 w-4 text-brand-purple\" />\n <h2 className=\"text-lg font-bold\">{title}</h2>\n </div>\n </div>\n <a\n href={allCreatorsHref}\n className=\"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground px-3 py-1.5 rounded-md hover:bg-accent transition-colors\"\n >\n View all <ArrowRight className=\"h-3.5 w-3.5\" />\n </a>\n </div>\n <div className=\"overflow-x-auto scrollbar-hide snap-x snap-mandatory -mx-4 px-4 md:mx-0 md:px-0\">\n <div className=\"flex gap-5 sm:gap-6 w-max pb-2\">\n {isLoading\n ? Array.from({ length: 6 }).map((_, i) => <CreatorChipSkeleton key={i} />)\n : creators.map((c) => (\n <CreatorChip key={c.walletAddress} creator={c} href={getHref(c)} />\n ))}\n </div>\n </div>\n </div>\n </FadeIn>\n );\n}\n"],"mappings":";AAmBI,cAsBE,YAtBF;AAjBJ,SAAS,gBAAgB;AACzB,SAAS,OAAO,kBAAkB;AAClC,SAAS,cAAc;AAEvB,SAAS,mBAAmB;AAW5B,SAAS,sBAAsB;AAC7B,SACE,oBAAC,SAAI,WAAU,iEAAgE;AAEnF;AAEA,SAAS,YAAY;AAAA,EACnB;AAAA,EACA;AACF,GAGG;AACD,QAAM,eAAe,YAAY;AACjC,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,KAAK;AAEpD,QAAM,SAAS,QAAQ,eAAe,QAAQ,mBAAmB;AACjE,QAAM,YAAY,UAAU,CAAC,cAAc,aAAa,MAAM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CAAC,KAA5C,EAAE,aAA6C,CAClE,GACP,GACF;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
@@ -98,7 +98,6 @@ function DiscoverFeedSection({
|
|
|
98
98
|
activities,
|
|
99
99
|
activitiesLoading,
|
|
100
100
|
lastUpdated,
|
|
101
|
-
getAssetHref = (c, t) => `/asset/${c}/${t}`,
|
|
102
101
|
marketplaceHref = "/marketplace",
|
|
103
102
|
activitiesHref = "/activities",
|
|
104
103
|
onBuyOrder,
|
|
@@ -130,7 +129,7 @@ function DiscoverFeedSection({
|
|
|
130
129
|
linkLabel: "Activities",
|
|
131
130
|
children: activitiesLoading ? Array.from({ length: 8 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-56 sm:w-64 snap-start shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_activity_card.ActivityCardSkeleton, {}) }, i)) : activities.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground py-4", children: "No activity yet. Be the first to trade on Medialane!" }) : activities.map((act, i) => {
|
|
132
131
|
const key = act.txHash ? `${act.txHash}-${act.type}-${act.nftTokenId ?? ""}` : `activity-${i}`;
|
|
133
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-56 sm:w-64 snap-start shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_activity_card.ActivityCard, { activity: act
|
|
132
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-56 sm:w-64 snap-start shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_activity_card.ActivityCard, { activity: act }) }, key);
|
|
134
133
|
})
|
|
135
134
|
}
|
|
136
135
|
) })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/discover-feed-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { Tag, Activity, RefreshCw, ArrowRight } from \"lucide-react\";\nimport { FadeIn } from \"./motion-primitives.js\";\nimport { ListingCard, ListingCardSkeleton } from \"./listing-card.js\";\nimport { ActivityCard, ActivityCardSkeleton } from \"./activity-card.js\";\nimport { timeAgo } from \"../utils/time.js\";\nimport { cn } from \"../utils/cn.js\";\nimport type { ApiOrder, ApiActivity } from \"@medialane/sdk\";\n\nexport interface DiscoverFeedSectionProps {\n orders: ApiOrder[];\n isLoading: boolean;\n activities: ApiActivity[];\n activitiesLoading: boolean;\n lastUpdated: string;\n
|
|
1
|
+
{"version":3,"sources":["../../src/components/discover-feed-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { Tag, Activity, RefreshCw, ArrowRight } from \"lucide-react\";\nimport { FadeIn } from \"./motion-primitives.js\";\nimport { ListingCard, ListingCardSkeleton } from \"./listing-card.js\";\nimport { ActivityCard, ActivityCardSkeleton } from \"./activity-card.js\";\nimport { timeAgo } from \"../utils/time.js\";\nimport { cn } from \"../utils/cn.js\";\nimport type { ApiOrder, ApiActivity } from \"@medialane/sdk\";\n\nexport interface DiscoverFeedSectionProps {\n orders: ApiOrder[];\n isLoading: boolean;\n activities: ApiActivity[];\n activitiesLoading: boolean;\n lastUpdated: string;\n explorerUrl?: string;\n marketplaceHref?: string;\n activitiesHref?: string;\n\n onBuyOrder?: (order: ApiOrder) => void;\n\n isOwnOrder?: (order: ApiOrder) => boolean;\n}\n\nfunction StripShell({\n icon,\n iconBg,\n title,\n subtitle,\n href,\n linkLabel,\n children,\n}: {\n icon: React.ReactNode;\n iconBg: string;\n title: string;\n subtitle?: React.ReactNode;\n href: string;\n linkLabel: string;\n children: React.ReactNode;\n}) {\n return (\n <section className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-2.5\">\n <div className={cn(\"h-7 w-7 rounded-lg flex items-center justify-center\", iconBg)}>\n {icon}\n </div>\n <div>\n <h2 className=\"text-lg sm:text-xl font-semibold leading-none\">{title}</h2>\n {subtitle && <p className=\"text-2xs text-muted-foreground mt-1\">{subtitle}</p>}\n </div>\n </div>\n <a\n href={href}\n className=\"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground px-3 py-1.5 rounded-md hover:bg-accent transition-colors\"\n >\n {linkLabel} <ArrowRight className=\"h-3.5 w-3.5\" />\n </a>\n </div>\n\n <div className=\"w-full overflow-x-auto scrollbar-hide\">\n <div className=\"flex gap-5 sm:gap-6 snap-x snap-mandatory pb-2\" style={{ width: \"max-content\" }}>\n {children}\n </div>\n </div>\n </section>\n );\n}\n\nexport interface DiscoverActivityStripProps {\n orders: ApiOrder[];\n isLoading: boolean;\n marketplaceHref?: string;\n onBuyOrder?: (order: ApiOrder) => void;\n isOwnOrder?: (order: ApiOrder) => boolean;\n}\n\nexport function DiscoverActivityStrip({\n orders,\n isLoading,\n marketplaceHref = \"/marketplace\",\n onBuyOrder,\n isOwnOrder,\n}: DiscoverActivityStripProps) {\n return (\n <FadeIn>\n <StripShell\n icon={<Tag className=\"h-3.5 w-3.5 text-white\" />}\n iconBg=\"bg-gradient-to-br from-rose-500 to-pink-600 shadow-md shadow-rose-500/20\"\n title=\"Activity\"\n href={marketplaceHref}\n linkLabel=\"View all\"\n >\n {isLoading\n ? Array.from({ length: 8 }).map((_, i) => (\n <div key={i} className=\"w-72 snap-start shrink-0\">\n <ListingCardSkeleton />\n </div>\n ))\n : orders.length === 0\n ? (\n <p className=\"text-sm text-muted-foreground py-4\">No active listings yet.</p>\n )\n : orders.map((order) => {\n const own = isOwnOrder?.(order) ?? false;\n return (\n <div key={order.orderHash} className=\"w-72 snap-start shrink-0\">\n <ListingCard\n order={order}\n onBuy={onBuyOrder && !own ? () => onBuyOrder(order) : undefined}\n />\n </div>\n );\n })}\n </StripShell>\n </FadeIn>\n );\n}\n\nexport function DiscoverFeedSection({\n orders,\n isLoading,\n activities,\n activitiesLoading,\n lastUpdated,\n marketplaceHref = \"/marketplace\",\n activitiesHref = \"/activities\",\n onBuyOrder,\n isOwnOrder,\n}: DiscoverFeedSectionProps) {\n return (\n <div className=\"space-y-14 sm:space-y-20\">\n <DiscoverActivityStrip\n orders={orders}\n isLoading={isLoading}\n marketplaceHref={marketplaceHref}\n onBuyOrder={onBuyOrder}\n isOwnOrder={isOwnOrder}\n />\n\n <FadeIn delay={0.08}>\n <StripShell\n icon={<Activity className=\"h-3.5 w-3.5 text-white\" />}\n iconBg=\"bg-gradient-to-br from-indigo-500 to-blue-600 shadow-md shadow-indigo-500/20\"\n title=\"Community\"\n subtitle={\n <span className=\"flex items-center gap-1\">\n <RefreshCw className=\"h-2.5 w-2.5\" />\n Updated {timeAgo(lastUpdated)}\n </span>\n }\n href={activitiesHref}\n linkLabel=\"Activities\"\n >\n {activitiesLoading\n ? Array.from({ length: 8 }).map((_, i) => (\n <div key={i} className=\"w-56 sm:w-64 snap-start shrink-0\">\n <ActivityCardSkeleton />\n </div>\n ))\n : activities.length === 0\n ? (\n <p className=\"text-sm text-muted-foreground py-4\">\n No activity yet. Be the first to trade on Medialane!\n </p>\n )\n : activities.map((act, i) => {\n const key = act.txHash\n ? `${act.txHash}-${act.type}-${act.nftTokenId ?? \"\"}`\n : `activity-${i}`;\n return (\n <div key={key} className=\"w-56 sm:w-64 snap-start shrink-0\">\n <ActivityCard activity={act} />\n </div>\n );\n })}\n </StripShell>\n </FadeIn>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8CU;AA5CV,0BAAqD;AACrD,+BAAuB;AACvB,0BAAiD;AACjD,2BAAmD;AACnD,kBAAwB;AACxB,gBAAmB;AAkBnB,SAAS,WAAW;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAQG;AACD,SACE,6CAAC,aAAQ,WAAU,aACjB;AAAA,iDAAC,SAAI,WAAU,qCACb;AAAA,mDAAC,SAAI,WAAU,6BACb;AAAA,oDAAC,SAAI,eAAW,cAAG,uDAAuD,MAAM,GAC7E,gB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