@@ -1,26 +1,26 @@
|
||||
import { DoorOpen, Users } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { DoorOpen, Users } from 'lucide-react'
|
||||
import Link from 'next/link'
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
|
||||
|
||||
interface UserRoom {
|
||||
id: number;
|
||||
name: string;
|
||||
state: string;
|
||||
users: number;
|
||||
usersMax: number;
|
||||
id: number
|
||||
name: string
|
||||
state: string
|
||||
users: number
|
||||
usersMax: number
|
||||
}
|
||||
|
||||
interface UserRoomsProps {
|
||||
rooms: UserRoom[];
|
||||
rooms: UserRoom[]
|
||||
}
|
||||
|
||||
const stateColors: Record<string, "default" | "secondary" | "outline" | "destructive"> = {
|
||||
open: "default",
|
||||
locked: "secondary",
|
||||
password: "destructive",
|
||||
invisible: "outline",
|
||||
};
|
||||
const stateColors: Record<string, 'default' | 'secondary' | 'outline' | 'destructive'> = {
|
||||
open: 'default',
|
||||
locked: 'secondary',
|
||||
password: 'destructive',
|
||||
invisible: 'outline',
|
||||
}
|
||||
|
||||
export function UserRooms({ rooms }: UserRoomsProps) {
|
||||
return (
|
||||
@@ -45,7 +45,7 @@ export function UserRooms({ rooms }: UserRoomsProps) {
|
||||
<div className="flex-1 min-w-0">
|
||||
<p className="text-sm font-medium truncate">{room.name}</p>
|
||||
<div className="flex items-center gap-2 mt-0.5">
|
||||
<Badge variant={stateColors[room.state] || "outline"} className="text-[10px]">
|
||||
<Badge variant={stateColors[room.state] || 'outline'} className="text-[10px]">
|
||||
{room.state}
|
||||
</Badge>
|
||||
<span className="text-xs text-muted-foreground flex items-center gap-1">
|
||||
@@ -61,5 +61,5 @@ export function UserRooms({ rooms }: UserRoomsProps) {
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user