import { Clock3, Trash2, X } from "lucide-react"; import { Button } from "@/components/ui/button"; import { cn } from "@/lib/utils"; import type { DashboardStockSearchHistoryItem } from "@/features/trade/types/trade.types"; interface StockSearchHistoryProps { items: DashboardStockSearchHistoryItem[]; selectedSymbol?: string; onSelect: (item: DashboardStockSearchHistoryItem) => void; onRemove: (symbol: string) => void; onClear: () => void; } /** * @description 최근 검색 종목 목록을 보여주고, 재검색/개별삭제/전체삭제를 제공합니다. * @see features/trade/components/TradeContainer.tsx 검색 패널에서 종목 재선택 UI로 사용합니다. * @see features/trade/hooks/useStockSearch.ts searchHistory 상태를 화면에 렌더링합니다. */ export function StockSearchHistory({ items, selectedSymbol, onSelect, onRemove, onClear, }: StockSearchHistoryProps) { if (items.length === 0) return null; return (
{/* ========== HISTORY HEADER ========== */}
최근 검색 종목
{/* ========== HISTORY LIST ========== */}
{items.map((item) => { const isSelected = item.symbol === selectedSymbol; return (
); })}
); }