diff --git a/frontend/src/lib/components/Room.svelte b/frontend/src/lib/components/Room.svelte
new file mode 100644
index 0000000..db8048f
--- /dev/null
+++ b/frontend/src/lib/components/Room.svelte
@@ -0,0 +1,16 @@
+
+
+
+
+ {room.name}
+ {#if room.private}
+ 🔒
+ {/if}
+
+
+
+
+
diff --git a/frontend/src/lib/components/RoomList.svelte b/frontend/src/lib/components/RoomList.svelte
deleted file mode 100644
index 75c411f..0000000
--- a/frontend/src/lib/components/RoomList.svelte
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
- {name}
- {#if locked}
- 🔒
- {/if}
-
-
- {participants} participant{participants === 1 ? '' : 's'}
-
-
\ No newline at end of file
diff --git a/frontend/src/lib/types.ts b/frontend/src/lib/types.ts
index 7de4960..0c2e8f5 100644
--- a/frontend/src/lib/types.ts
+++ b/frontend/src/lib/types.ts
@@ -10,12 +10,12 @@ const SongSchema = z.object({
})
export type Song = z.infer
-export const parseSong = async function (song: any): Promise {
+export const parseSong = async function(song: any): Promise {
let resp = await SongSchema.parseAsync(song)
return resp
}
-export const createEmptySong = function (): Song {
+export const createEmptySong = function(): Song {
return {
uuid: "-1",
title: "",
@@ -31,11 +31,25 @@ const SuggestionSchema = SongSchema.extend({
})
export type Suggestion = z.infer
-export const parseSuggestion = async function (sugg: any): Promise {
+export const parseSuggestion = async function(sugg: any): Promise {
let resp = await SuggestionSchema.parseAsync(sugg)
return resp
}
+const RoomSchema = z.object({
+ id: z.string(),
+ name: z.string(),
+ private: z.boolean(),
+ coords: z.tuple([z.number(), z.number()]),
+ range: z.number().int()
+})
+export type Room = z.infer
+
+export const parseRoom = async function(room: any): Promise {
+ let resp = await RoomSchema.parseAsync(room)
+ return resp
+}
+
export type FetchError = {
code: number
message: string
diff --git a/frontend/src/routes/+page.svelte b/frontend/src/routes/+page.svelte
index 7f0da53..e5c870a 100644
--- a/frontend/src/routes/+page.svelte
+++ b/frontend/src/routes/+page.svelte
@@ -1,5 +1,8 @@
@@ -7,17 +10,17 @@
Scan your nearby rooms
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-