import type { ContentNode } from './content-tree'; /** The blocks a content page starts with (written to the database the first time the page is opened; edit them afterwards * through /api/blocks, not here). */ export function defaultBlocks(n: ContentNode): { type: string; data: any }[] { if (n.kind === 'tools') { return [ { type: 'stats', data: { node: n.id, items: [ { metric: 'area-papers', label: 'papers in this area' }, ...n.taxonomy.map((t) => ({ metric: 'taxonomy-papers', arg: t, label: 'in taxonomy: {name}' })), { metric: 'benchmark-count', label: 'benchmarks most used here' }, ] } }, { type: 'tool-table', data: { caption: 'Tools by category', note: '{tools} tools from {papers} papers. A tool can sit in several categories. A category lists every tool filed under it or under a category below it (marked “via …”); each tool links to the paper that designed it.' } }, { type: 'benchmark-table', data: { node: n.id, scope: 'areas', caption: 'Benchmarks used' } }, ]; } return [ { type: 'stats', data: { node: n.id, items: [ { metric: 'group-papers', label: 'papers in this group' }, { metric: 'group-analysed', label: 'analysed in depth' }, { metric: 'group-venues', arg: 4, label: 'at {name}' }, ] } }, { type: 'benchmark-table', data: { node: n.id, scope: 'papers', caption: 'Benchmarks these papers use' } }, { type: 'paper-table', data: { node: n.id, caption: 'All papers in the group', note: 'Matched by text (title, abstract, keywords); a paper may be a false match.' } }, ]; }