{
  "id": "pet-log",
  "name": "Pet Log",
  "category": "lifestyle",
  "tags": ["pets", "dog", "cat", "tracker"],
  "description": "Log pet feedings, walks, and activities with timestamps.",
  "triggers": ["pet log", "dog tracker", "cat tracker", "pet care"],
  "defaultSize": { "w": 4, "h": 4 },
  "source": "function PetLog() {\n  const [logs, setLogs] = React.useState([\n    { pet: 'Baxter', activity: 'Walk', time: new Date(Date.now() - 2 * 3600000).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) },\n    { pet: 'Luna', activity: 'Fed', time: new Date(Date.now() - 5 * 3600000).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) },\n    { pet: 'Baxter', activity: 'Fed', time: new Date(Date.now() - 8 * 3600000).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) }\n  ]);\n  const [pet, setPet] = React.useState('');\n  const [activity, setActivity] = React.useState('Walk');\n  const activities = ['Walk', 'Fed', 'Play', 'Groom', 'Vet', 'Medicine'];\n\n  function addLog() {\n    if (!pet.trim()) return;\n    const time = new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });\n    setLogs([{ pet, activity, time }, ...logs]);\n    setPet('');\n  }\n\n  function removeLog(idx) {\n    setLogs(logs.filter((_, i) => i !== idx));\n  }\n\n  return (\n    <div style={{ fontFamily: 'system-ui, sans-serif', padding: 16, background: '#fff', borderRadius: 12, height: '100%', boxSizing: 'border-box', display: 'flex', flexDirection: 'column' }}>\n      <h2 style={{ margin: '0 0 12px 0', fontSize: 18, color: '#1a1a1a' }}>Pet Log</h2>\n      <div style={{ display: 'flex', gap: 8, marginBottom: 12 }}>\n        <input placeholder=\"Pet name\" value={pet} onChange={e => setPet(e.target.value)} style={{ flex: 1, padding: '6px 10px', borderRadius: 6, border: '1px solid #ddd', fontSize: 13 }} />\n        <select value={activity} onChange={e => setActivity(e.target.value)} style={{ padding: '6px 10px', borderRadius: 6, border: '1px solid #ddd', fontSize: 13, background: '#fff' }}>\n          {activities.map(a => <option key={a} value={a}>{a}</option>)}\n        </select>\n        <button onClick={addLog} style={{ padding: '6px 14px', borderRadius: 6, border: 'none', background: '#f59e0b', color: '#fff', fontSize: 13, cursor: 'pointer' }}>Log</button>\n      </div>\n      <div style={{ flex: 1, overflowY: 'auto' }}>\n        {logs.map((log, i) => (\n          <div key={i} style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '10px 12px', borderRadius: 8, background: '#f8f9fa', marginBottom: 8 }}>\n            <div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>\n              <span style={{ fontSize: 20 }}>{log.activity === 'Walk' ? '\\ud83c\\udfc3' : log.activity === 'Fed' ? '\\ud83c\\udf7d\\ufe0f' : log.activity === 'Play' ? '\\ud83c\\udfae' : log.activity === 'Groom' ? '\\u2702\\ufe0f' : log.activity === 'Vet' ? '\\ud83d\\udc8a' : '\\ud83d\\udc31'}</span>\n              <div>\n                <div style={{ fontWeight: 600, fontSize: 14, color: '#1a1a1a' }}>{log.pet}</div>\n                <div style={{ fontSize: 12, color: '#666' }}>{log.activity}</div>\n              </div>\n            </div>\n            <div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>\n              <span style={{ fontSize: 12, color: '#888' }}>{log.time}</span>\n              <button onClick={() => removeLog(i)} style={{ background: 'transparent', border: 'none', color: '#999', cursor: 'pointer', fontSize: 14 }}>x</button>\n            </div>\n          </div>\n        ))}\n        {logs.length === 0 && <div style={{ textAlign: 'center', color: '#999', fontSize: 13, padding: 20 }}>No logs yet. Add one above!</div>}\n      </div>\n    </div>\n  );\n}\nrender(<PetLog/>);",
  "placeholders": []
}
