EditMenuDB

This commit is contained in:
2025-10-17 23:01:13 +02:00
parent 8c1bd0426f
commit 95c6de37e9

View File

@@ -9,6 +9,12 @@ import { useToast } from '../components/ui/use-toast';
import ColorPicker from '../components/ColorPicker';
import { getHabits, saveHabit, updateHabit } from '../lib/datastore';
// Local helper to get habit by id from localStorage
function getHabit(id) {
const habits = JSON.parse(localStorage.getItem('habitgrid_data') || '[]');
return habits.find(h => h.id === id);
}
const AddEditHabitPage = () => {
const { id } = useParams();
const navigate = useNavigate();