From 0fd9fb097552686f2257c1aa689d797e80057bd1 Mon Sep 17 00:00:00 2001
From: Elizabeth Hunt <elizabeth.hunt@simponic.xyz>
Date: Wed, 19 Jul 2023 20:38:24 -0700
Subject: initial commit

---
 client/src/components/LeaderBoard.svelte | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 client/src/components/LeaderBoard.svelte

(limited to 'client/src/components/LeaderBoard.svelte')

diff --git a/client/src/components/LeaderBoard.svelte b/client/src/components/LeaderBoard.svelte
new file mode 100644
index 0000000..d6e4ce3
--- /dev/null
+++ b/client/src/components/LeaderBoard.svelte
@@ -0,0 +1,25 @@
+<script lang="ts">
+  import { type LeaderBoardEntry } from "../../lib/interfaces";
+  import LeaderBoardCard from "./LeaderBoardCard.svelte";
+
+  const MAX_ENTRIES = 8;
+
+  export let entries: LeaderBoardEntry[] = [];
+</script>
+
+<div class="leaderboard">
+  {#each entries
+    .sort((a, b) => b.score - a.score)
+    .slice(0, MAX_ENTRIES) as entry}
+    <LeaderBoardCard {entry} />
+  {/each}
+</div>
+
+<style>
+  .leaderboard {
+    display: grid;
+    grid-template-columns: repeat(4, 1fr);
+    grid-template-rows: repeat(2, 1fr);
+    gap: 10px;
+  }
+</style>
-- 
cgit v1.2.3-70-g09d2

