(function(){ // ============================================================ // stats.jsx — StatsView ("Reflektieren"-Tab) // Depends on window: localISO, todayISO, getCatColor, prioCol // ============================================================ function StatsView({ nonDeletedTodos, isMobile, data, settings, streakDays, longestStreak, avgCycle, moved, weekDone, weekCreated, weekStart, dayPlanArchive, last7Stats, maxStat, next7, setShowReview }){ const {localISO, todayISO, getCatColor, prioCol} = window; const t = window.t; const [statsSendSt, setStatsSendSt] = React.useState(""); const modules = settings.statsModules || {}; const show = (key) => modules[key] !== false; const WD = window.currentLang==="en" ? ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"] : ["So","Mo","Di","Mi","Do","Fr","Sa"]; const WD_MON = window.currentLang==="en" ? ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"] : ["Mo","Di","Mi","Do","Fr","Sa","So"]; const locale = window.currentLang==="en" ? "en-GB" : "de-CH"; return(
{window.t("stats.letGoNote")}
{t("stats.noTodosWithCategory")}
; const maxTotal=Math.max(...rows.map(r=>r.total),1); return rows.sort((a,b)=>b.total-a.total).map((r,i)=>{ const cc=r.cat?getCatColor(data.categories,r.cat):null; const pct=r.total?Math.round(r.done/r.total*100):0; const widthPct=Math.round(r.total/maxTotal*100); return(