/* How loaded each editor is, week by week.
The rule: two short videos a day or one long one, Monday to Saturday. So a
short video costs half a day, a long one a full day, and the cap is six days
a week. A task lands in the week of its deadline — work with no deadline
cannot be placed and is called out separately, because unplanned work is
exactly what blows a week up. */
function WeekCell({ week, capacity, onOpen, directory }) {
const used = week.days;
const pct = capacity ? Math.min(100, (used / capacity) * 100) : 0;
const over = used > capacity;
const tight = !over && used >= capacity * 0.85;
const tone = over ? 'var(--red)' : tight ? 'var(--amber)' : 'var(--green)';
return (
{used % 1 === 0 ? used : used.toFixed(1)}
/ {capacity} days
{over && +{(used - capacity).toFixed(1)}}