Skip to content

Commit e64139e

Browse files
committed
refactor: update MemberRow component to remove localization
- Removed localization parameters from the MemberRow component, simplifying the code and enhancing maintainability. - Adjusted the useParams hook to eliminate locale handling and updated the profile link accordingly. - Integrated AlertDialog components for improved user interaction.
1 parent b8f4faf commit e64139e

File tree

1 file changed

+16
-18
lines changed
  • apps/app/src/app/(app)/(dashboard)/[orgId]/people/all/components

1 file changed

+16
-18
lines changed

apps/app/src/app/(app)/(dashboard)/[orgId]/people/all/components/MemberRow.tsx

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
"use client";
22

3-
import React, { useState } from "react";
43
import { Edit, MoreHorizontal, Trash2 } from "lucide-react";
54
import Link from "next/link";
65
import { useParams } from "next/navigation";
6+
import { useState } from "react";
77

8+
import {
9+
AlertDialog,
10+
AlertDialogAction,
11+
AlertDialogCancel,
12+
AlertDialogContent,
13+
AlertDialogDescription,
14+
AlertDialogFooter,
15+
AlertDialogHeader,
16+
AlertDialogTitle,
17+
} from "@comp/ui/alert-dialog";
818
import { Avatar, AvatarFallback, AvatarImage } from "@comp/ui/avatar";
919
import { Badge } from "@comp/ui/badge";
1020
import { Button } from "@comp/ui/button";
@@ -20,25 +30,13 @@ import {
2030
DropdownMenu,
2131
DropdownMenuContent,
2232
DropdownMenuItem,
23-
DropdownMenuLabel,
24-
DropdownMenuSeparator,
25-
DropdownMenuTrigger,
33+
DropdownMenuTrigger
2634
} from "@comp/ui/dropdown-menu";
2735
import { Label } from "@comp/ui/label";
28-
import {
29-
AlertDialog,
30-
AlertDialogAction,
31-
AlertDialogCancel,
32-
AlertDialogContent,
33-
AlertDialogDescription,
34-
AlertDialogFooter,
35-
AlertDialogHeader,
36-
AlertDialogTitle,
37-
} from "@comp/ui/alert-dialog";
3836
import type { Role } from "@prisma/client";
3937

40-
import type { MemberWithUser } from "./TeamMembers";
4138
import { MultiRoleCombobox } from "./MultiRoleCombobox";
39+
import type { MemberWithUser } from "./TeamMembers";
4240

4341
interface MemberRowProps {
4442
member: MemberWithUser;
@@ -62,8 +60,8 @@ function getInitials(name?: string | null, email?: string | null): string {
6260
}
6361

6462
export function MemberRow({ member, onRemove, onUpdateRole }: MemberRowProps) {
65-
const params = useParams<{ locale: string; orgId: string }>();
66-
const { locale, orgId } = params;
63+
const params = useParams<{ orgId: string }>();
64+
const { orgId } = params;
6765
const [isRoleDialogOpen, setIsRoleDialogOpen] = useState(false);
6866
const [isRemoveAlertOpen, setIsRemoveAlertOpen] = useState(false);
6967
const [selectedRoles, setSelectedRoles] = useState<Role[]>(
@@ -131,7 +129,7 @@ export function MemberRow({ member, onRemove, onUpdateRole }: MemberRowProps) {
131129
<span>{memberName}</span>
132130
{isEmployee && (
133131
<Link
134-
href={`/${locale}/${orgId}/people/${memberId}`}
132+
href={`/${orgId}/people/${memberId}`}
135133
className="text-xs text-blue-600 hover:underline"
136134
>
137135
({"View Profile"})

0 commit comments

Comments
 (0)