diff --git a/apps/documentation/app/[locale]/[project]/[...docPath]/_components/TableOfContents.tsx b/apps/documentation/app/[locale]/[project]/[...docPath]/_components/TableOfContents.tsx index 5a6be331..e164847d 100644 --- a/apps/documentation/app/[locale]/[project]/[...docPath]/_components/TableOfContents.tsx +++ b/apps/documentation/app/[locale]/[project]/[...docPath]/_components/TableOfContents.tsx @@ -1,9 +1,9 @@ import { type HeadingNode } from '~/lib/tableOfContents'; import TOCLink from './TOCLink'; -interface TableOfContentsProps { +type TableOfContentsProps = { nodes: HeadingNode[] | null; -} +}; const TableOfContents = ({ nodes }: TableOfContentsProps) => { if (!nodes) return null; @@ -14,7 +14,7 @@ const TableOfContents = ({ nodes }: TableOfContentsProps) => { nodes.length > 10 && 'h-[750px]' } min-w-[300px] overflow-y-auto`} > -

Table of contents

+

Table of contents

{renderNodes(nodes)} ); diff --git a/apps/documentation/app/[locale]/[project]/[...docPath]/page.tsx b/apps/documentation/app/[locale]/[project]/[...docPath]/page.tsx index 63b177fe..7fb0d09e 100644 --- a/apps/documentation/app/[locale]/[project]/[...docPath]/page.tsx +++ b/apps/documentation/app/[locale]/[project]/[...docPath]/page.tsx @@ -28,7 +28,7 @@ export function generateMetadata({ params }: { params: PageParams }) { project, pathSegment: docPath, }); - if (!doc || !doc.title) { + if (!doc?.title) { throw new Error(`Error getting document title for:${docPath.join('')}`); } @@ -78,7 +78,7 @@ const Page = async ({ params }: { params: PageParams }) => { pathSegment: docPath, }); - if (!doc || doc?.content === null) notFound(); + if (!doc?.content) notFound(); // Frontmatter data of markdown files const { @@ -95,7 +95,7 @@ const Page = async ({ params }: { params: PageParams }) => { return (
-
+

{title}

{interfaceSummary && } @@ -107,7 +107,7 @@ const Page = async ({ params }: { params: PageParams }) => { source={content} /> {bestPractices && } -

{lastUpdated}

+

{lastUpdated}

{headings && (
diff --git a/apps/documentation/app/[locale]/[project]/page.tsx b/apps/documentation/app/[locale]/[project]/page.tsx index d200db8f..30c6caa7 100644 --- a/apps/documentation/app/[locale]/[project]/page.tsx +++ b/apps/documentation/app/[locale]/[project]/page.tsx @@ -21,13 +21,13 @@ export default function Page({ params }: PageProps) { pathSegment: ['index'], // pointing to home page for the project }); - if (!doc || doc?.content === null) notFound(); + if (!doc?.content) notFound(); // Frontmatter data of markdown files const { title, content, lastUpdated } = doc; return ( -
+

{title}

-

{lastUpdated}

+

{lastUpdated}

); } diff --git a/apps/documentation/app/[locale]/_components/Navbar/Search/CustomSearchBox.tsx b/apps/documentation/app/[locale]/_components/Navbar/Search/CustomSearchBox.tsx index bec97a06..a6641830 100644 --- a/apps/documentation/app/[locale]/_components/Navbar/Search/CustomSearchBox.tsx +++ b/apps/documentation/app/[locale]/_components/Navbar/Search/CustomSearchBox.tsx @@ -7,9 +7,9 @@ import { useSearchBox, } from 'react-instantsearch'; -interface CustomSearchBoxProps extends UseSearchBoxProps { +type CustomSearchBoxProps = { placeholder: string; -} +} & UseSearchBoxProps; export default function CustomSearchBox(props: CustomSearchBoxProps) { const { query, refine } = useSearchBox(props); @@ -49,7 +49,7 @@ export default function CustomSearchBox(props: CustomSearchBoxProps) { >
{isSearchStalled ? ( - + ) : ( )} diff --git a/apps/documentation/app/[locale]/_components/Navbar/Search/Provider/DialogContext.tsx b/apps/documentation/app/[locale]/_components/Navbar/Search/Provider/DialogContext.tsx index 2cb320c3..cebe16ca 100644 --- a/apps/documentation/app/[locale]/_components/Navbar/Search/Provider/DialogContext.tsx +++ b/apps/documentation/app/[locale]/_components/Navbar/Search/Provider/DialogContext.tsx @@ -7,12 +7,12 @@ type DialogContextType = { export const DialogContext = createContext({ open: false, - setOpen: () => {}, + setOpen: () => undefined, }); -interface DialogContextProviderProps extends DialogContextType { +type DialogContextProviderProps = { children: React.ReactNode; -} +} & DialogContextType; export const DialogContextProvider: React.FC = ({ children, diff --git a/apps/documentation/app/[locale]/_components/Navbar/languageSwitcher.tsx b/apps/documentation/app/[locale]/_components/Navbar/languageSwitcher.tsx index 0c3a331f..fa355071 100644 --- a/apps/documentation/app/[locale]/_components/Navbar/languageSwitcher.tsx +++ b/apps/documentation/app/[locale]/_components/Navbar/languageSwitcher.tsx @@ -13,9 +13,9 @@ import data from '~/public/sidebar.json'; import { type SidebarData } from '~/types'; import { useLocale } from 'next-intl'; -interface LanguageSwitcherProps { +type LanguageSwitcherProps = { width: string; -} +}; const LanguageSwitcher = ({ width }: LanguageSwitcherProps) => { const locale = useLocale(); @@ -43,11 +43,11 @@ const LanguageSwitcher = ({ width }: LanguageSwitcherProps) => { return (