Skip to content

Commit 07ad57c

Browse files
refactor(users): remove unused SearchBar component
1 parent 8155e3a commit 07ad57c

2 files changed

Lines changed: 49 additions & 53 deletions

File tree

src/app/(main)/dashboard/users/_components/UserBadge.tsx

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
11
"use client"
22

3-
import { cn } from "@/lib/utils"
4-
53
interface UserBadgeProps {
6-
status: "Active" | "Pending" | "Suspended"
4+
status: "Active" | "Disabled"
75
}
86

97
export function UserBadge({ status }: UserBadgeProps) {
10-
const colors = {
11-
Active: "bg-emerald-100 text-emerald-800 dark:bg-emerald-900/40 dark:text-emerald-300",
12-
Pending: "bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-300",
13-
Suspended: "bg-rose-100 text-rose-800 dark:bg-rose-900/40 dark:text-rose-300",
14-
}
15-
168
return (
179
<span
18-
className={cn(
19-
"inline-flex items-center rounded-full border border-transparent px-2 py-[2px] text-xs font-semibold capitalize transition-all duration-200 hover:scale-[1.05]",
20-
colors[status]
21-
)}
10+
className={
11+
status === "Active"
12+
? "text-emerald-600 font-medium"
13+
: "text-muted-foreground"
14+
}
2215
>
2316
{status}
2417
</span>

src/lib/demo-users.ts

Lines changed: 43 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,45 @@
1-
/**
2-
* Génère un tableau d'utilisateurs factices pour le mode démo.
3-
*/
4-
5-
const firstNames = [
6-
"Emma", "Noah", "Liam", "Olivia", "Ava", "Sophia", "Mia", "Isabella",
7-
"Lucas", "Ethan", "James", "Amelia", "Charlotte", "Benjamin", "Logan",
8-
"Harper", "Daniel", "Chloe", "Jackson", "Evelyn"
9-
]
10-
11-
const lastNames = [
12-
"Smith", "Johnson", "Brown", "Taylor", "Anderson", "Thomas", "Jackson",
13-
"White", "Harris", "Martin", "Thompson", "Garcia", "Martinez", "Lee"
14-
]
15-
16-
const roles = ["Admin", "Editor", "Viewer"]
17-
const statuses = ["Active", "Pending", "Suspended"]
18-
19-
function random<T>(arr: T[]): T {
20-
return arr[Math.floor(Math.random() * arr.length)]
1+
export type User = {
2+
id: number
3+
name: string
4+
email: string
5+
role: string
6+
status: "Active" | "Disabled"
217
}
228

23-
export function generateDemoUsers(count = 25) {
24-
const users = []
25-
26-
for (let i = 1; i <= count; i++) {
27-
const first = random(firstNames)
28-
const last = random(lastNames)
29-
const name = `${first} ${last}`
30-
const email = `${first.toLowerCase()}.${last.toLowerCase()}@example.com`
31-
32-
users.push({
33-
id: i,
34-
name,
35-
email,
36-
role: random(roles),
37-
status: random(statuses),
38-
})
39-
}
40-
41-
return users
42-
}
9+
export const demoUsers: User[] = [
10+
{
11+
id: 1,
12+
name: "Emma Smith",
13+
email: "emma.smith@example.com",
14+
role: "Admin",
15+
status: "Active",
16+
},
17+
{
18+
id: 2,
19+
name: "Liam Johnson",
20+
email: "liam.johnson@example.com",
21+
role: "Editor",
22+
status: "Disabled",
23+
},
24+
{
25+
id: 3,
26+
name: "Olivia Brown",
27+
email: "olivia.brown@example.com",
28+
role: "Viewer",
29+
status: "Active",
30+
},
31+
{
32+
id: 4,
33+
name: "Noah Taylor",
34+
email: "noah.taylor@example.com",
35+
role: "Editor",
36+
status: "Active",
37+
},
38+
{
39+
id: 5,
40+
name: "Ava Anderson",
41+
email: "ava.anderson@example.com",
42+
role: "Viewer",
43+
status: "Disabled",
44+
},
45+
]

0 commit comments

Comments
 (0)