Share information about your brand with your customers. Describe a product, make announcements, or welcome customers to your store.

365 Challenge

import React, { useEffect, useState } from "react";

export default function HanziWidget() {
const [data, setData] = useState(null);
const [checked, setChecked] = useState(false);

useEffect(() => {
fetch("/api/today")
.then(res => res.json())
.then(setData);
}, []);

const handleCheckin = async () => {
await fetch("/api/checkin", { method: "POST" });
setChecked(true);
};

if (!data) return Loading...;

return (
>

📅 今日汉字

{data.char}

{data.pinyin} | {data.meaning}

例句: {data.sentence}


{checked ? "✅ 已打卡" : "打卡学习"}

🎁 完成挑战,获得智能戒指


);
}