import { fetchClaims } from "@/app/api/claims";
import React from "react";
import ClaimSearch from "./ClaimSearch";
import ClaimSearchLoading from "./ClaimSearchLoading";

interface SubComponents {
  Loading: typeof ClaimSearchLoading;
}

const ClaimSearchWrapper: React.FC & SubComponents = async () => {
  const claims = await fetchClaims();

  return <ClaimSearch claims={claims} />;
};

ClaimSearchWrapper.Loading = ClaimSearchLoading;

export default ClaimSearchWrapper;
