// #281 공통 별점 컴포넌트 — ReviewSection/MemoSection/MyReviewsList 재사용. // 0.5 단위 시각 구분: 빈 별 위에 황색 절반 별을 절대배치 + clip으로 표시. interface StarsProps { rating: number; // 0~5, 0.5 단위 size?: "sm" | "md"; showNumber?: boolean; className?: string; } export default function Stars({ rating, size = "sm", showNumber = false, className = "" }: StarsProps) { const r = Math.max(0, Math.min(5, rating)); const textSize = size === "md" ? "text-base" : "text-sm"; return ( {[1, 2, 3, 4, 5].map((i) => { const full = r >= i; const half = !full && r >= i - 0.5; return ( {(full || half) && ( )} ); })} {showNumber && r > 0 && {r}} ); }