Skip to content

Commit

Permalink
geminiエラーの表示 (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttizze authored Jul 22, 2024
1 parent eeb37e6 commit eb1cf52
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions web/app/routes/translate/components/GeminiApiKeyForm.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useForm } from "@conform-to/react";
import { getFormProps, getInputProps } from "@conform-to/react";
import type { SubmissionResult } from "@conform-to/react";
import { getZodConstraint, parseWithZod } from "@conform-to/zod";
import { Form, useActionData } from "@remix-run/react";
import { Link } from "@remix-run/react";
Expand All @@ -12,13 +11,13 @@ import { Button } from "~/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "~/components/ui/card";
import { Input } from "~/components/ui/input";
import { geminiApiKeySchema } from "../types";

import type { action } from "../route";
export function GeminiApiKeyForm() {
const lastResult = useActionData<SubmissionResult>();
const actionData = useActionData<typeof action>();
const navigation = useNavigation();
const [form, { geminiApiKey }] = useForm({
id: "gemini-api-key-form",
lastResult,
lastResult: actionData?.lastResult,
constraint: getZodConstraint(geminiApiKeySchema),
shouldValidate: "onBlur",
shouldRevalidate: "onInput",
Expand Down

0 comments on commit eb1cf52

Please sign in to comment.