The Node.js® Website
1'use client';
2
3import { useContext } from 'react';
4
5import { MatterContext } from '@/providers/matterProvider';
6import type { ClientSharedServerContext } from '@/types';
7
8const useClientContext = (): ClientSharedServerContext => {
9 const { frontmatter, pathname, headings, readingTime, filename } =
10 useContext(MatterContext);
11
12 return { pathname, frontmatter, headings, readingTime, filename };
13};
14
15export default useClientContext;