import m, {MithrilComponent} from '@garage44/mithril' import {FieldSegmented} from '@garage44/mithril/components' import {History} from '@/components/history' import {Log} from '@/components/log' import {go, here} from '@/lib/route' /** Which half is open: the address says (`/activity/events`, or the old `/log`). */ const half = () => (/^(log|activity\/events)$/.test(here()) ? 'events' : 'stats') /** * How the work flows, in one place: the numbers and charts (once History) and * what happened, line by line (once Log). Both are for looking back; neither is * where anything waits for the person. */ export class Activity extends MithrilComponent { which = { get value() { return half() }, set value(v: string) { go(v === 'events' ? 'activity/events' : 'activity') }, } view() { return (