28 lines
825 B
TypeScript
28 lines
825 B
TypeScript
import { listRooms } from "@/utils/rooms/rooms";
|
|
import { CreateRoomForm } from "./create-room-form";
|
|
import { RoomsList, type RoomEntry } from "./rooms-list";
|
|
|
|
export default async function RoomsPage() {
|
|
const rawRooms = await listRooms();
|
|
const rooms: RoomEntry[] = rawRooms ?? [];
|
|
|
|
return (
|
|
<div className="mx-auto max-w-3xl px-6 py-10">
|
|
<h1 className="text-2xl font-semibold text-neutral-900">Rooms</h1>
|
|
<p className="mt-1 text-sm text-neutral-500">
|
|
Your conversations will appear here.
|
|
</p>
|
|
|
|
<div className="mt-8 space-y-8">
|
|
{/* Create room */}
|
|
<div className="rounded-xl border border-neutral-200 bg-white p-5 shadow-sm">
|
|
<CreateRoomForm />
|
|
</div>
|
|
|
|
{/* Rooms list */}
|
|
<RoomsList rooms={rooms} />
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|