hunk.code_window:     ...displayFlex('center', 'center'),
       flexDirection: 'column',
       padding: '5px 16px',
       fontSize: theme.font.sm,
       span: {
         width: '100%',
         fontWeight: '500',
       },
  
hunk.labels: keep keep keep replace keep keep keep keep
hunk.after_edit:     fontSize: theme.font.base,
  
hunk.file_path: packages/app/src/components/quick-search/style.ts
hunk.type: replace
file: import { useCallback, useEffect, useState } from 'react';
  import { useAppState, PageMeta } from '@/providers/app-state-provider';
  
  export const useCurrentPageMeta = (): PageMeta | null => {
    const { currentPage, currentWorkspace } = useAppState();
  
    const pageMetaHandler = useCallback((): PageMeta | null => {
      if (!currentPage || !currentWorkspace) {
        return null;
      }
      return (
        (currentWorkspace.blocksuiteWorkspace?.meta.pageMetas.find(
          p => p.id === currentPage.id
        ) as PageMeta) ?? null
      );
    }, [currentPage, currentWorkspace]);
  
    const [currentPageMeta, setCurrentPageMeta] = useState<PageMeta | null>(
      pageMetaHandler
    );
  
    useEffect(() => {
      setCurrentPageMeta(pageMetaHandler);
  
      const dispose = currentWorkspace?.blocksuiteWorkspace?.meta.pagesUpdated.on(
        () => {
          setCurrentPageMeta(pageMetaHandler);
        }
      ).dispose;
  
      return () => {
        dispose?.();
      };
    }, [currentPage, currentWorkspace, pageMetaHandler]);
  
    return currentPageMeta;
  };
  
  export default useCurrentPageMeta;
  