"use client"; import { FolderSync } from "lucide-react"; import { useEffect, useState } from "react"; import { CdnChooser } from "@/components/chooser"; import { Button } from "@/components/ui/button"; import { Spinner } from "@/components/ui/spinner"; import { Switch } from "@/components/ui/switch"; import { shared } from "@/lib/comms"; import { syncAmber, toggleEnka } from "./api"; import { Section } from "./page"; export function SettingsServicesSection({ enka: enkaInitial, }: { enka: boolean; }) { const [syncing, setSyncing] = useState(false); const [syncResult, setSyncResult] = useState(""); const [enka, setEnka] = useState(); const [debug] = shared.state("debug"); useEffect(() => { if (typeof enka !== "boolean") return setEnka(enkaInitial); toggleEnka(enka); }, [enka, enkaInitial]); async function sync() { setSyncing(true); syncAmber() .then(setSyncResult) .finally(() => setSyncing(false)); } return (
เปิดใช้การดึงตัวละครใน Artifact
{debug && (
Test file input
)} {syncResult && (
{syncResult}
)}
); }