import React from 'react';
import { useState } from 'react';
import { PlusIcon, MinusIcon } from '@heroicons/react/24/outline';
export default function WaterTracker() {
const [waterIntake, setWaterIntake] = useState(0);
const goal = 2000; // 每日目標 (ml)
const addWater = (amount) => {
setWaterIntake(prev => Math.min(prev + amount, 5000));
};
const removeWater = (amount) => {
setWaterIntake(prev => Math.max(prev - amount, 0));
};
const progress = (waterIntake / goal) * 100;
return (
今日飲水追蹤
{/* 進度顯示 */}
目前進度
{waterIntake} / {goal} ml
{/* 快速添加按鈕 */}
{/* 自定義輸入 */}
{/* 今日記錄 */}
今日記錄
時間 |
數量 (ml) |
14:30 |
300 |
12:00 |
500 |
09:15 |
200 |
);
}