forked from BRETT/BRETT
Shared Spinner component for button loading states
Adds a reusable shadcn-style Spinner (lucide loader-circle icon, localized aria-label) and wires it into every button that has a pending state: comment submit, delete, tag save, profile save, admin saves, upload, login and register. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
@@ -15,6 +15,7 @@ import {
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from '@/components/ui/select'
|
||||
import { Spinner } from '@/components/ui/spinner'
|
||||
import { Textarea } from '@/components/ui/textarea'
|
||||
|
||||
definePageMeta({ middleware: 'admin' })
|
||||
@@ -219,6 +220,7 @@ async function saveMotd() {
|
||||
:disabled="savingRole === role.id"
|
||||
@click="savePermissions(role)"
|
||||
>
|
||||
<Spinner v-if="savingRole === role.id" />
|
||||
{{ savingRole === role.id ? $t('common.saving') : $t('common.save') }}
|
||||
</Button>
|
||||
<Button
|
||||
@@ -323,6 +325,7 @@ async function saveMotd() {
|
||||
class="min-h-16"
|
||||
/>
|
||||
<Button type="submit" class="shrink-0" :disabled="motdSaving">
|
||||
<Spinner v-if="motdSaving" />
|
||||
{{ motdSaving ? $t('common.saving') : $t('common.save') }}
|
||||
</Button>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user