"use client"; import { useState, useEffect } from "react"; import { Switch } from "@/components/ui/switch"; import { Label } from "@/components/ui/label"; import { Database, Globe } from "lucide-react"; export function CacheOnlySwitch() { const [cacheOnly, setCacheOnly] = useState(false); const isProd = process.env.NODE_ENV === "production"; // Carregar preferência do localStorage useEffect(() => { const saved = localStorage.getItem("cache_only_mode"); if (saved) { setCacheOnly(saved === "true"); } }, []); // Salvar preferência const handleToggle = (checked: boolean) => { setCacheOnly(checked); localStorage.setItem("cache_only_mode", checked.toString()); }; // Só exibir em produção if (!isProd) return null; return (
{cacheOnly ? ( ) : ( )}
); }