import React from 'react';
import { useNavigate } from 'react-router-dom';
import { motion } from 'framer-motion';
import { ChevronRight, Flame } from 'lucide-react';
import { Button } from './ui/button';
import MiniGrid from './MiniGrid';
import AnimatedCounter from './AnimatedCounter';
// Helper to get streak icon from localStorage or fallback
function getStreakIcon() {
const icon = typeof window !== 'undefined' ? localStorage.getItem('streakIcon') : null;
if (!icon || icon === 'flame') return ;
return {icon};
}
const HabitCard = ({ habit, onUpdate }) => {
const navigate = useNavigate();
return (
navigate(`/habit/${habit.id}`)}
>
{getStreakIcon()}
day streak
•
Personal Record: days
);
};
export default HabitCard;