import { HydrationBoundary, dehydrate } from '@tanstack/react-query';
import PageContainer from '@/components/layout/page-container';
import { crmReferenceQueryOptions } from '@/features/crm-demo/api/queries';
import { DocumentSequencesPage } from '@/features/crm-demo/components/settings-page';
import { getQueryClient } from '@/lib/query-client';

export default function DocumentSequencesRoute() {
  const queryClient = getQueryClient();
  void queryClient.prefetchQuery(crmReferenceQueryOptions());

  return (
    <PageContainer
      pageTitle='Document Sequences'
      pageDescription='Mock document sequence แยกตาม branch และ document type'
    >
      <HydrationBoundary state={dehydrate(queryClient)}>
        <DocumentSequencesPage />
      </HydrationBoundary>
    </PageContainer>
  );
}
