Skip to content

Commit

Permalink
update nextjs AI generate sample (#8143)
Browse files Browse the repository at this point in the history
  • Loading branch information
ykethan authored Dec 1, 2024
1 parent 7a57277 commit 99e934b
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions src/pages/[platform]/ai/set-up-ai/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,17 @@ export default function App() {
<Block name="Pages router">

```tsx title="pages/index.tsx"
import { Flex, TextAreaField, Loader, Text, View } from "@aws-amplify/ui-react"
import { useAIConversation } from "@/client";
import { useAIGeneration } from "@/client";
import {
Button,
Flex,
Heading,
Loader,
Text,
TextAreaField,
View,
} from "@aws-amplify/ui-react";
import React from "react";

export default function Page() {
const [description, setDescription] = React.useState("");
Expand Down Expand Up @@ -429,8 +438,18 @@ export default function Page() {
<Block name="App router">

```tsx title="app/page.tsx"
'use client'
import { useAIConversation } from "@/client";
"use client";
import { useAIGeneration } from "@/client";
import {
Button,
Flex,
Heading,
Loader,
Text,
TextAreaField,
View,
} from "@aws-amplify/ui-react";
import React from "react";

export default function Page() {
const [description, setDescription] = React.useState("");
Expand Down

0 comments on commit 99e934b

Please sign in to comment.