Skip to content

Commit

Permalink
docs: use twoslash include (#671)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonom authored Aug 18, 2024
1 parent fa43954 commit f9640b6
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions apps/docs/content/docs/runtimes/custom-rest.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ npm install @assistant-ui/react

Update the `MyModelAdapter` below to integrate with your own custom API.

```tsx twoslash {1,11,17} title="@/app/MyRuntimeProvider.tsx"
```tsx twoslash include MyRuntimeProvider title="@/app/MyRuntimeProvider.tsx"
// @filename: /app/MyRuntimeProvider.tsx

// ---cut---
"use client";

import type { ReactNode } from "react";
Expand Down Expand Up @@ -93,17 +96,9 @@ export function MyRuntimeProvider({

### Wrap your app in `MyRuntimeProvider`

`@/app/layout.tsx`

```tsx {1,11,17} twoslash
// @filename: /app/MyRuntimeProvider.tsx

import type { FC, PropsWithChildren } from "react";

export const MyRuntimeProvider: FC<PropsWithChildren> = () => null;

// @filename: index.tsx

```tsx {1,11,17} twoslash title="@/app/layout.tsx"
// @include: MyRuntimeProvider
// @filename: /app/layout.tsx
// ---cut---
import type { ReactNode } from "react";
import { MyRuntimeProvider } from "@/app/MyRuntimeProvider";
Expand Down

0 comments on commit f9640b6

Please sign in to comment.