import m from '@garage44/mithril' import {nameOf} from '@/lib/names' import {shortName} from '@/lib/format' /** A session, by its readable name, linked to its conversation where it has one. */ export function who(owner: string, opts: {sub?: boolean; max?: number} = {}) { const n = nameOf(owner) const title = shortName(n.title, opts.max ?? 60) return ( {n.link ? ( {title} ) : ( {title} )} {opts.sub && n.sub ? {n.sub} : null} ) }