nyuchimzizi
Mzizi — an open-architecture project of the Bundu Foundation, operated and developed by Nyuchi. Built on the Five African Minerals palette.
Built by Nyuchi Africav4.0.39
Commerce offer/product card for Bush Trade with price display, original/discount pricing, availability, seller verification badge, and inquiry CTA. Maps to commerce.offer and commerce.product tables. Used in Bush Trade marketplace, commerce listings, and deal displays.
View the full component source code below.
"use client"
// ── INFRASTRUCTURE HARNESS (auto-wired) ──
// Every brand component participates in observability, motion, a11y,
// and health monitoring via the harness. Zero manual config.
import { useNyuchiHarness } from "@/lib/harness"
import * as React from "react"
import { ShoppingBag, Tag, Clock, MessageCircle, Shield } from "@/lib/icons"
import { cn } from "@/lib/utils"
interface NyuchiOfferCardProps {
title: string
image?: string
price: number
originalPrice?: number
currency?: string
sellerName?: string
sellerVerified?: boolean
category?: string
condition?: "new" | "used" | "refurbished"
availableUntil?: string
location?: string
mineral?: "malachite" | "cobalt" | "gold" | "tanzanite" | "terracotta"
onInquire?: () => void
onClick?: () => void
className?: string
}
function NyuchiOfferCard({ loading = false,
title, image, price, originalPrice, currency = "USD",
sellerName, sellerVerified, category, condition,
availableUntil, location, mineral = "malachite",
onInquire, onClick, className,
}: NyuchiOfferCardProps) {
const { log, motion, LiveRegion } = useNyuchiHarness("offer-card")
const animStyle = React.useMemo(() => motion.prefersReduced ? {} : { animation: `nyuchi-fade-slide-up ${motion.enterDuration}ms ${motion.enterEasing} both` }, [motion])
if (loading) return (<div data-slot="nyuchi-offer-card" data-portal="https://design.nyuchi.com/components/nyuchi-offer-card" data-loading role="article" className="animate-pulse rounded-[var(--radius-lg,14px)] bg-card p-4 ring-1 ring-foreground/10 space-y-3"><div className="flex gap-3"><div className="size-20 shrink-0 rounded-[var(--radius-md,12px)] bg-muted" /><div className="flex-1 space-y-2"><div className="h-3.5 w-3/4 rounded bg-muted" /><div className="h-2.5 w-1/2 rounded bg-muted" /><div className="h-4 w-1/3 rounded bg-muted" /></div></div></div>)
const formatter = new Intl.NumberFormat(undefined, { style: "currency", currency })
const hasDiscount = originalPrice != null && originalPrice > price
const discountPercent = hasDiscount ? Math.round((1 - price / originalPrice!) * 100) : 0
const mineralColors: Record<string, string> = {
malachite: "var(--color-malachite,#64FFDA)", cobalt: "var(--color-cobalt,#00B0FF)", gold: "var(--color-gold,#FFD740)", tanzanite: "var(--color-tanzanite,#B388FF)", terracotta: "var(--color-terracotta,#D4A574)",
}
const accent = mineralColors[mineral]
return (
<div data-slot="nyuchi-offer-card" role="article" tabIndex={0} className="focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--color-primary,#00B0FF)] min-h-[48px]" onClick={onClick}
className={cn("overflow-hidden rounded-[var(--radius-card,14px)] bg-card ring-1 ring-foreground/10", onClick && "cursor-pointer hover:shadow-md transition-shadow", className)}>
{/* Image */}
{image && (
<div className="relative aspect-square overflow-hidden bg-muted">
<img src={image} alt={title} className="size-full object-cover transition-transform hover:scale-105" />
{hasDiscount && (
<span className="absolute top-2 left-2 rounded-full px-2 py-0.5 text-[10px] font-bold text-background" style={{ backgroundColor: accent }}>
-{discountPercent}%
</span>
)}
{condition && condition !== "new" && (
<span className="absolute top-2 right-2 rounded-full bg-black/50 px-2 py-0.5 text-[10px] font-medium capitalize text-white backdrop-blur-sm">
{condition}
</span>
)}
</div>
)}
<div className="p-3">
{category && <span className="text-[10px] font-semibold uppercase tracking-wider text-muted-foreground">{category}</span>}
<h4 className="mt-0.5 line-clamp-2 text-sm font-medium text-foreground">{title}</h4>
{/* Price */}
<div className="mt-1.5 flex items-baseline gap-2">
<span className="text-base font-bold text-foreground">{formatter.format(price)}</span>
{hasDiscount && <span className="text-xs text-muted-foreground line-through">{formatter.format(originalPrice!)}</span>}
</div>
{/* Seller info */}
{sellerName && (
<div className="mt-2 flex items-center gap-1.5 text-xs text-muted-foreground">
<ShoppingBag className="size-3" />
<span>{sellerName}</span>
{sellerVerified && <Shield className="size-3 text-[var(--color-gold)]" />}
</div>
)}
{/* Inquiry CTA */}
{onInquire && (
<button onClick={(e) => { e.stopPropagation(); onInquire() }}
className="mt-3 flex h-9 w-full items-center justify-center gap-1.5 rounded-full text-xs font-semibold text-background transition-colors"
style={{ backgroundColor: accent }}>
<MessageCircle className="size-3.5" />Inquire
</button>
)}
</div>
</div>
)
}
export { NyuchiOfferCard }
export type { NyuchiOfferCardProps }
npx shadcn@latest add https://mzizi.dev/api/v1/ui/nyuchi-offer-cardFetch this component's metadata and source code from the registry API.
/api/v1/ui/nyuchi-offer-cardcomponents/mukoko/mukoko-offer-card.tsx