You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importReact,{useState}from'react';import{Spinner}from'./Spinner';// Certifique-se de importar o componente Spinner corretamenteconstSpinnerDemo=()=>{const[loading,setLoading]=useState(false);return(<divclassName="flex flex-col items-center gap-4"><h2>Spinner Demo</h2>{/* Caso 1: Spinner sem loadingText e com text */}<div><Spinnerloading={false}text="Enviar dados"/></div>{/* Caso 2: Spinner sem loadingText e com children */}<div><Spinnerloading={false}><span>Enviar</span></Spinner></div>{/* Caso 3: Spinner com loadingText */}<div><Spinnerloading={true}loadingText="Carregando..."/></div>{/* Caso 4: Spinner com loadingText e text */}<div><Spinnerloading={false}text="Enviar dados"loadingText="Enviando..."/></div>{/* Caso 5: Spinner com loadingText e children */}<div><Spinnerloading={false}loadingText="Enviando..."><span>Enviar</span></Spinner></div>{/* Caso 6: Spinner com loadingText, text e children */}<div><Spinnerloading={false}text="Enviar dados"loadingText="Enviando..."><span>Enviar</span></Spinner></div>{/* Caso 7: Spinner sem text e children */}<div><Spinnerloading={false}/></div>{/* Botão para simular carregamento */}<buttononClick={()=>{setLoading(true);setTimeout(()=>setLoading(false),2000);// Simula um carregamento de 2 segundos}}className="mt-4 px-4 py-2 bg-blue-500 text-white rounded">
Simular Carregamento
</button></div>);};exportdefaultSpinnerDemo;
The text was updated successfully, but these errors were encountered:
Spinner component
Use Case
The text was updated successfully, but these errors were encountered: