- {page.content} -
-+ {page.content} +
+
diff --git a/web/app/routes/$userName+/page+/$slug+/components/TargetLanguageSelector.tsx b/web/app/routes/$userName+/page+/$slug+/components/TargetLanguageSelector.tsx
index 1f329b12..033396dd 100644
--- a/web/app/routes/$userName+/page+/$slug+/components/TargetLanguageSelector.tsx
+++ b/web/app/routes/$userName+/page+/$slug+/components/TargetLanguageSelector.tsx
@@ -1,29 +1,26 @@
import { useFetcher } from "@remix-run/react";
+import { Check, ChevronsUpDown } from "lucide-react";
import { useCallback, useEffect, useState } from "react";
+import { Button } from "~/components/ui/button";
import {
- Select,
- SelectContent,
- SelectItem,
- SelectTrigger,
- SelectValue,
-} from "~/components/ui/select";
-
-type TargetLanguage = {
- code: string;
- name: string;
-};
-
-const targetLanguages: TargetLanguage[] = [
- { code: "ja", name: "日本語" },
- { code: "en", name: "English" },
- { code: "zh", name: "中文" },
- { code: "ko", name: "한국어" },
- { code: "es", name: "Español" },
- { code: "fr", name: "Français" },
-];
+ Command,
+ CommandEmpty,
+ CommandGroup,
+ CommandInput,
+ CommandItem,
+ CommandList,
+} from "~/components/ui/command";
+import {
+ Popover,
+ PopoverContent,
+ PopoverTrigger,
+} from "~/components/ui/popover";
+import { cn } from "~/utils/cn";
+import { targetLanguages } from "../constants/languages";
export default function TargetLanguageSelector() {
const fetcher = useFetcher<{ targetLanguage: string }>();
+ const [open, setOpen] = useState(false);
const [currentLanguage, setCurrentLanguage] = useState(
fetcher.data?.targetLanguage ?? "ja",
);
@@ -31,6 +28,8 @@ export default function TargetLanguageSelector() {
const loadLanguage = useCallback(() => {
if (fetcher.state === "idle" && !fetcher.data) {
fetcher.load("/api/target-language");
+ } else if (fetcher.state === "idle" && fetcher.data?.targetLanguage) {
+ setCurrentLanguage(fetcher.data.targetLanguage);
}
}, [fetcher]);
@@ -40,6 +39,7 @@ export default function TargetLanguageSelector() {
const handleLanguageChange = (value: string) => {
setCurrentLanguage(value);
+ setOpen(false);
fetcher.submit(
{ targetLanguage: value },
{ method: "post", action: "/api/target-language" },
@@ -47,17 +47,48 @@ export default function TargetLanguageSelector() {
};
return (
-
+ {item.aiModel}
+ {new Date(item.createdAt).toLocaleString()}
+
- EveEve is an open-source platform where users can post articles and collaborate on translations, fostering global understanding and knowledge sharing. -
-+ EveEve is an open-source platform where users can post articles and + collaborate on translations, fostering global understanding and + knowledge sharing. +
+- Simple interface for effortless article posting and translation. -
-- A community-driven platform that continuously evolves. -
-- Access and contribute to content in multiple languages. -
-+ Simple interface for effortless article posting and + translation. +
++ A community-driven platform that continuously evolves. +
++ Access and contribute to content in multiple languages. +
+- EveEveは、インターネット上のテキストを翻訳し、共有し、より良い翻訳を作り上げていくオープンソースプロジェクトです。 -
-- シンプルなインターフェースで、誰でも簡単に翻訳を始められます。 -
-- コミュニティの力で、常に進化し続けるプラットフォーム。 -
-- 多言語対応で、世界中のコンテンツにアクセス可能。 -
-- This Privacy Policy describes how EveEve ("we", "our", or "us") collects, uses, and shares your personal information when you use our service. -
-+ This Privacy Policy describes how EveEve ("we", "our", or "us") + collects, uses, and shares your personal information when you use + our service. +
+We collect the following types of information:
-We collect the following types of information:
+We use your information to:
-We use your information to:
+We may share your information in the following circumstances:
-+ We may share your information in the following circumstances: +
+- We implement reasonable security measures to protect your personal information. However, no method of transmission over the Internet or electronic storage is 100% secure. -
-+ We implement reasonable security measures to protect your personal + information. However, no method of transmission over the Internet or + electronic storage is 100% secure. +
+You have the right to:
-You have the right to:
+- We may update this Privacy Policy from time to time. We will notify you of any changes by posting the new Privacy Policy on this page and updating the "Last updated" date. -
-+ We may update this Privacy Policy from time to time. We will notify + you of any changes by posting the new Privacy Policy on this page + and updating the "Last updated" date. +
+- If you have any questions about this Privacy Policy, please contact us at: [Your Contact Information] -
-+ If you have any questions about this Privacy Policy, please contact + us at: [Your Contact Information] +
+Last updated: [Date]
-Last updated: [Date]
+