import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "../../components/ui/dropdown-menu"; import { Skeleton } from "../../components/ui/skeleton"; import { TableCell, TableRow } from "../../components/ui/table"; import { type DialogKind, type User } from "./types"; export function UserRowActions({ user, isSelf, onAction, onViewSessions, }: { user: User; isSelf: boolean; onAction: (kind: DialogKind, user: User) => void; onViewSessions: (userId: string) => void; }) { return ( } /> onAction("role", user)}>Set Role {user.banned ? ( onAction("ban", user)}>Unban User ) : ( !isSelf && onAction("ban", user)}>Ban User )} onViewSessions(user.id)}>View Sessions {!isSelf && ( <> onAction("delete", user)}> Delete User )} ); } export function SkeletonRows() { return ( <> {[0, 1, 2, 3, 4].map((i) => (
))} ); }