"use client"; import { motion } from "framer-motion"; import { MoveRight, Star, X } from "lucide-react"; import { CurrencyIcon } from "@/components/converter/currency-icon"; import { Button } from "@/components/ui/button"; import { type PinnedPair } from "@/hooks/use-pinned-pairs"; import type { RateAsset } from "@/lib/rates"; import { cn } from "@/lib/utils"; interface PinnedPairItem { pair: PinnedPair; fromAsset: RateAsset; toAsset: RateAsset; } interface ConverterCardPinnedPairsProps { shouldReduceMotion: boolean; isCurrentPairPinned: boolean; hasReachedPinnedPairsLimit: boolean; pinStarAnimationStep: number; pinnedPairItems: PinnedPairItem[]; fromCode: string; toCode: string; isPinnedPairsReady: boolean; maxPinnedPairs: number; onTogglePinnedCurrentPair: () => void; onSelectPinnedPair: (pair: PinnedPair) => void; onRemovePinnedPair: (pair: PinnedPair) => void; } export function ConverterCardPinnedPairs({ shouldReduceMotion, isCurrentPairPinned, hasReachedPinnedPairsLimit, pinStarAnimationStep, pinnedPairItems, fromCode, toCode, isPinnedPairsReady, maxPinnedPairs, onTogglePinnedCurrentPair, onSelectPinnedPair, onRemovePinnedPair, }: ConverterCardPinnedPairsProps) { return (

Pinned pairs

{pinnedPairItems.length > 0 ? (
{pinnedPairItems.map(({ pair, fromAsset, toAsset }) => { const isActive = pair.fromCode === fromCode && pair.toCode === toCode; return (
); })}
) : null} {isPinnedPairsReady && pinnedPairItems.length === 0 ? (

Pin your most-used pairs for one-click access.

) : null} {hasReachedPinnedPairsLimit ? (

Pinned pairs limit reached ({maxPinnedPairs}). Remove one to add a new pair.

) : null}
); }