import { arr, str, type Capability } from "./types" /** * Direction cards: the kinds of project we take on. * * The buying question is "what can you build for me", not "what do you build * with", so each card names a project category and the concrete deliverables * under it. The fill comes from `rp-capability-card` in `index.css` rather than * a `bg-` utility, because the band alternates between the page background and * `--rp-c-bg-soft` and the card has to invert against whichever it lands on. */ export function Capabilities({ items }: { items?: Capability[] }) { const cards = (arr(items) ?? []) .map((item) => ({ title: str(item?.title) ?? "", details: str(item?.details), icon: str(item?.icon), // `arr` is an assertion, not a guarantee — frontmatter is parsed by // gray-matter at runtime and takes no part in MDX type checking, so each // entry still goes through `str` before it reaches the DOM. entries: (arr(item?.subItems) ?? []).map((entry) => str(entry)), })) .filter((card) => card.title !== "") if (cards.length === 0) return null return (
    {cards.map(({ title, details, icon, entries }, index) => (
  • {icon && ( )}

    {title}

    {details && (

    {details}

    )} {entries.length > 0 && (
      {entries.map((entry, entryIndex) => entry ? (
    • {entry}
    • ) : null )}
    )}
  • ))}
) }