import { CharityPage } from '@/pages-templates/charity';

import { mainPageApi } from '@/features/pages/api/pages.api';

import { makeStore } from '@/shared/store';

export default async function Charity() {
  const store = makeStore();

  const { data, isLoading, error } = await store.dispatch(
    mainPageApi.endpoints.fetchCharityPageContent.initiate(),
  );

  if (isLoading || !data) return null;

  return <CharityPage content={data} />;
}
