import type { RollTableResultSet } from '../rolltable'; import { Fragment } from 'preact'; export type AttributionSetProps = Pick export function reconstituteAttributionSetIfExists(element: HTMLParagraphElement | null, partial?: Partial|null): AttributionSetProps|null { if (!element || partial === null) { return null } return reconstituteAttributionSet(element, partial) } export function reconstituteAttributionSet(p: HTMLParagraphElement, partial?: Partial): AttributionSetProps { return { id: partial?.id ?? parseInt(p.dataset.id!!), name: partial?.name ?? p.querySelector(".setName")?.innerText ?? null, global: partial?.global ?? p.classList.contains('global'), } } export function AttributionSet({global, name, id}: AttributionSetProps) { return

in {name ? 'the' : 'a'} {global ? 'global' : 'server-local'} set {name && {' '}{name}}

}