Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

744 B
Raw Blame
import type { AssistantMessage } from '@trek/shared';

import type { CardsBlock } from '../assistantParts';
import { viewOf } from './cardViews';
import CardBoundary from './parts/CardBoundary';

/**
 * The answer cards of one group, drawn by their kind's `Block`. A kind with
 * no view yet draws nothing, and a card that throws is left out with the rest
 * of the answer still in place.
 */
export default function AssistantCardBlock({ block, message }: { block: CardsBlock; message: AssistantMessage }) {
  const first = block.entries[0];
  const Block = first ? viewOf(first.card).Block : undefined;
  if (!Block) return null;
  return (
    <CardBoundary>
      <Block cards={block.entries} message={message} />
    </CardBoundary>
  );
}