Skip to content

Commit

Permalink
fix: replace button loading text with spinner
Browse files Browse the repository at this point in the history
  • Loading branch information
VaneSkubic committed Feb 26, 2025
1 parent 449949f commit 1d0c81f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/examples/api-example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import { useGetRandomFact } from '@/api/endpoints';
import { Button } from '@/components/ui/button';
import { useScopedI18n } from '@/i18n/client';
import { Loader2Icon } from 'lucide-react';
import { toast } from 'sonner';

const ApiExample = () => {
Expand Down Expand Up @@ -32,7 +33,11 @@ const ApiExample = () => {

return (
<Button variant="outline" onClick={handleFetch} disabled={isFetching}>
{t('submit')}
{isFetching ? (
<Loader2Icon className="h-4 w-4 animate-spin" />
) : (
t('submit')
)}
</Button>
);
};
Expand Down

0 comments on commit 1d0c81f

Please sign in to comment.