feat(inbox): ContinuityBadge with recovery-friendly copy

Task 23 of the slice plan. Reads continuity from the zustand
store and renders one of three states: '이번 주 한 줄이면
시작입니다' (0 notes), '이번 주 N/7' (in-progress), or
'이번 주 7/7 ✓ · 연속 K주 완성' (target hit, with K only when
> 0). No '실패'/'끊김' wording.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
altair823
2026-04-25 12:17:52 +09:00
parent 6b522b31d0
commit bc05e21245

View File

@@ -1,2 +1,25 @@
import React from 'react';
export function ContinuityBadge() { return null; }
import { useInbox } from '../store.js';
export function ContinuityBadge(): React.ReactElement | null {
const c = useInbox((s) => s.continuity);
if (!c.weekStart) return null;
if (c.weekCount === 0) {
return <div style={{ fontSize: 13, color: '#666' }}> </div>;
}
if (c.weekCount < c.weekTarget) {
return (
<div style={{ fontSize: 13, color: '#444' }}>
<b>{c.weekCount}/{c.weekTarget}</b>
</div>
);
}
return (
<div style={{ fontSize: 13, color: '#236b1a' }}>
<b>{c.weekCount}/{c.weekTarget}</b>
{c.consecutiveCompleteWeeks > 0 && (
<span style={{ color: '#888' }}> · {c.consecutiveCompleteWeeks} </span>
)}
</div>
);
}