style: apply prettier formatting across frontend components and pages
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -87,7 +87,9 @@
|
||||
<div class="py-3 sm:py-6 sm:pl-6">
|
||||
<div class="flex items-center justify-between mb-6 px-3 sm:px-0">
|
||||
<h1 class="text-2xl font-bold">{$_("admin.users.title")}</h1>
|
||||
<span class="text-sm text-muted-foreground">{$_("admin.users.total", { values: { total: data.total } })}</span>
|
||||
<span class="text-sm text-muted-foreground"
|
||||
>{$_("admin.users.total", { values: { total: data.total } })}</span
|
||||
>
|
||||
</div>
|
||||
|
||||
<!-- Filters -->
|
||||
@@ -120,11 +122,21 @@
|
||||
<table class="w-full text-sm">
|
||||
<thead class="bg-muted/30">
|
||||
<tr>
|
||||
<th class="px-4 py-3 text-left font-medium text-muted-foreground">{$_("admin.users.col_user")}</th>
|
||||
<th class="px-4 py-3 text-left font-medium text-muted-foreground hidden sm:table-cell">{$_("admin.users.col_email")}</th>
|
||||
<th class="px-4 py-3 text-left font-medium text-muted-foreground">{$_("admin.users.col_role")}</th>
|
||||
<th class="px-4 py-3 text-left font-medium text-muted-foreground hidden md:table-cell">{$_("admin.users.col_joined")}</th>
|
||||
<th class="px-4 py-3 text-right font-medium text-muted-foreground">{$_("admin.users.col_actions")}</th>
|
||||
<th class="px-4 py-3 text-left font-medium text-muted-foreground"
|
||||
>{$_("admin.users.col_user")}</th
|
||||
>
|
||||
<th class="px-4 py-3 text-left font-medium text-muted-foreground hidden sm:table-cell"
|
||||
>{$_("admin.users.col_email")}</th
|
||||
>
|
||||
<th class="px-4 py-3 text-left font-medium text-muted-foreground"
|
||||
>{$_("admin.users.col_role")}</th
|
||||
>
|
||||
<th class="px-4 py-3 text-left font-medium text-muted-foreground hidden md:table-cell"
|
||||
>{$_("admin.users.col_joined")}</th
|
||||
>
|
||||
<th class="px-4 py-3 text-right font-medium text-muted-foreground"
|
||||
>{$_("admin.users.col_actions")}</th
|
||||
>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-border/30">
|
||||
@@ -147,12 +159,18 @@
|
||||
{/if}
|
||||
<div class="min-w-0">
|
||||
<div class="flex items-center gap-1.5">
|
||||
<span class="font-medium truncate">{user.artist_name || user.first_name || "—"}</span>
|
||||
<span class="font-medium truncate"
|
||||
>{user.artist_name || user.first_name || "—"}</span
|
||||
>
|
||||
{#if user.is_admin}
|
||||
<Badge variant="default" class="shrink-0 text-[10px] px-1.5 py-0">{$_("admin.users.admin_badge")}</Badge>
|
||||
<Badge variant="default" class="shrink-0 text-[10px] px-1.5 py-0"
|
||||
>{$_("admin.users.admin_badge")}</Badge
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
<span class="text-xs text-muted-foreground sm:hidden truncate block">{user.email}</span>
|
||||
<span class="text-xs text-muted-foreground sm:hidden truncate block"
|
||||
>{user.email}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
@@ -173,7 +191,9 @@
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-muted-foreground hidden md:table-cell">{formatDate(user.date_created)}</td>
|
||||
<td class="px-4 py-3 text-muted-foreground hidden md:table-cell"
|
||||
>{formatDate(user.date_created)}</td
|
||||
>
|
||||
<td class="px-4 py-3 text-right">
|
||||
<div class="flex items-center justify-end gap-1">
|
||||
<Button size="sm" variant="ghost" href="/admin/users/{user.id}">
|
||||
@@ -195,7 +215,9 @@
|
||||
|
||||
{#if data.items.length === 0}
|
||||
<tr>
|
||||
<td colspan="5" class="px-4 py-8 text-center text-muted-foreground">{$_("admin.users.no_results")}</td>
|
||||
<td colspan="5" class="px-4 py-8 text-center text-muted-foreground"
|
||||
>{$_("admin.users.no_results")}</td
|
||||
>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
@@ -206,7 +228,13 @@
|
||||
{#if data.total > data.limit}
|
||||
<div class="flex items-center justify-between mt-4 px-3 sm:px-0">
|
||||
<span class="text-sm text-muted-foreground">
|
||||
{$_("admin.users.showing", { values: { start: data.offset + 1, end: Math.min(data.offset + data.limit, data.total), total: data.total } })}
|
||||
{$_("admin.users.showing", {
|
||||
values: {
|
||||
start: data.offset + 1,
|
||||
end: Math.min(data.offset + data.limit, data.total),
|
||||
total: data.total,
|
||||
},
|
||||
})}
|
||||
</span>
|
||||
<div class="flex gap-2">
|
||||
<Button
|
||||
@@ -244,7 +272,9 @@
|
||||
<Dialog.Header>
|
||||
<Dialog.Title>{$_("admin.users.delete_title")}</Dialog.Title>
|
||||
<Dialog.Description>
|
||||
{$_("admin.users.delete_description", { values: { name: deleteTarget?.artist_name || deleteTarget?.email } })}
|
||||
{$_("admin.users.delete_description", {
|
||||
values: { name: deleteTarget?.artist_name || deleteTarget?.email },
|
||||
})}
|
||||
</Dialog.Description>
|
||||
</Dialog.Header>
|
||||
<Dialog.Footer>
|
||||
|
||||
@@ -106,7 +106,11 @@
|
||||
</Button>
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold">{data.user.artist_name || data.user.email}</h1>
|
||||
<p class="text-xs text-muted-foreground">{data.user.email} · {data.user.role}{data.user.is_admin ? " · " + $_("admin.users.admin_badge").toLowerCase() : ""}</p>
|
||||
<p class="text-xs text-muted-foreground">
|
||||
{data.user.email} · {data.user.role}{data.user.is_admin
|
||||
? " · " + $_("admin.users.admin_badge").toLowerCase()
|
||||
: ""}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -155,8 +159,14 @@
|
||||
</div>
|
||||
|
||||
<!-- Admin flag -->
|
||||
<label class="flex items-center gap-3 rounded-lg border border-border/40 px-4 py-3 cursor-pointer hover:bg-muted/20 transition-colors">
|
||||
<input type="checkbox" bind:checked={isAdmin} class="h-4 w-4 rounded accent-primary shrink-0" />
|
||||
<label
|
||||
class="flex items-center gap-3 rounded-lg border border-border/40 px-4 py-3 cursor-pointer hover:bg-muted/20 transition-colors"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
bind:checked={isAdmin}
|
||||
class="h-4 w-4 rounded accent-primary shrink-0"
|
||||
/>
|
||||
<div>
|
||||
<span class="text-sm font-medium">{$_("admin.user_edit.is_admin")}</span>
|
||||
<p class="text-xs text-muted-foreground">{$_("admin.user_edit.is_admin_hint")}</p>
|
||||
@@ -164,7 +174,11 @@
|
||||
</label>
|
||||
|
||||
<div class="flex gap-3">
|
||||
<Button onclick={handleSave} disabled={saving} class="bg-gradient-to-r from-primary to-accent hover:from-primary/90 hover:to-accent/90">
|
||||
<Button
|
||||
onclick={handleSave}
|
||||
disabled={saving}
|
||||
class="bg-gradient-to-r from-primary to-accent hover:from-primary/90 hover:to-accent/90"
|
||||
>
|
||||
{saving ? $_("admin.common.saving") : $_("admin.common.save_changes")}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user