"use server";

import { loadTrailCardByUri } from "../data/queries";
import { TrailCard } from "./TrailCard";

export async function loadTrailCard(uri: string): Promise<React.ReactElement | null> {
  const trail = await loadTrailCardByUri(uri);
  if (!trail) return null;
  return <TrailCard {...trail} />;
}
