import { memo } from 'react'; import { motion } from 'framer-motion'; import { dayjs, decodeHtmlEntities } from '@/utils'; /** * Mobile용 생일 카드 컴포넌트 * @param {Object} schedule - 일정 데이터 * @param {boolean} showYear - 년도 표시 여부 * @param {number} delay - 애니메이션 딜레이 (초) * @param {function} onClick - 클릭 핸들러 */ const BirthdayCard = memo(function BirthdayCard({ schedule, showYear = false, delay = 0, onClick }) { const scheduleDate = dayjs(schedule.date); const formatted = { year: scheduleDate.year(), month: scheduleDate.month() + 1, day: scheduleDate.date(), }; const CardContent = (
{/* 배경 장식 */}
🎉
{/* 멤버 사진 */} {schedule.member_image && (
{schedule.member_names}
)} {/* 내용 */}
🎂

{decodeHtmlEntities(schedule.title)}

{/* 날짜 뱃지 (showYear가 true일 때만 표시) */} {showYear && (
{formatted.year}
{formatted.month}월
{formatted.day}
)}
); // delay가 있으면 motion 사용 if (delay > 0) { return ( {CardContent} ); } return (
{CardContent}
); }); export default BirthdayCard;