Skip to content

Commit 7fd59cc

Browse files
committed
エラー修正
1 parent 9b025ea commit 7fd59cc

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

app/[docs_id]/chatForm.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
import { useState, FormEvent, useEffect } from "react";
44
import { askAI } from "@/app/actions/chatActions";
55
import useSWR from "swr";
6-
import { getQuestionExample } from "../actions/questionExample";
6+
import {
7+
getQuestionExample,
8+
QuestionExampleParams,
9+
} from "../actions/questionExample";
710
import { getLanguageName } from "../pagesList";
811
import { DynamicMarkdownSection } from "./pageContent";
912
import { useEmbedContext } from "../terminal/embedContext";
@@ -38,7 +41,10 @@ export function ChatForm({
3841
.join("\n\n");
3942
const { data: exampleData, error: exampleError } = useSWR(
4043
// 質問フォームを開いたときだけで良い
41-
{ lang, documentContentInView },
44+
{
45+
lang,
46+
documentContent: documentContentInView,
47+
} satisfies QuestionExampleParams,
4248
getQuestionExample,
4349
{
4450
// リクエストは古くても構わないので1回でいい

app/[docs_id]/pageContent.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"use client";
22

3-
import { ReactNode, useEffect, useRef, useState } from "react";
3+
import { useEffect, useRef, useState } from "react";
44
import { MarkdownSection } from "./splitMarkdown";
55
import { ChatForm } from "./chatForm";
66
import { Heading, StyledMarkdown } from "./markdown";
7-
import { ChatHistoryProvider, useChatHistoryContext } from "./chatHistory";
7+
import { useChatHistoryContext } from "./chatHistory";
88
import clsx from "clsx";
99

1010
// MarkdownSectionに追加で、ユーザーが今そのセクションを読んでいるかどうか、などの動的な情報を持たせる

app/actions/chatActions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use server";
22

3-
import { z } from "zod";
3+
// import { z } from "zod";
44
import { generateContent } from "./gemini";
55
import { DynamicMarkdownSection } from "../[docs_id]/pageContent";
66
import { ReplCommand, ReplOutput } from "../terminal/repl";

app/actions/questionExample.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const QuestionExampleSchema = z.object({
88
documentContent: z.string().min(1),
99
});
1010

11-
type QuestionExampleParams = z.input<typeof QuestionExampleSchema>;
11+
export type QuestionExampleParams = z.input<typeof QuestionExampleSchema>;
1212

1313
export async function getQuestionExample(
1414
params: QuestionExampleParams

app/terminal/python/page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default function PythonPage() {
1111
return (
1212
<div className="p-4 flex flex-col gap-4">
1313
<ReplTerminal
14+
terminalId=""
1415
initRuntime={init}
1516
runtimeInitializing={initializing}
1617
runtimeReady={ready}

0 commit comments

Comments
 (0)