Skip to content

Commit

Permalink
added driver option to race tab (#179)
Browse files Browse the repository at this point in the history
* added driver option to race tab

* added rfid data to race tab
  • Loading branch information
skand088 authored Jan 18, 2025
1 parent 72ced70 commit 82938e0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/client/src/components/tabs/RaceTab.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import axios from "axios";
import Image from "next/image";
import { useEffect, useMemo, useState } from "react";

import { usePacket } from "@/contexts/PacketContext";
import type { ILapData } from "@shared/helios-types";
import {
createColumnHelper,
Expand Down Expand Up @@ -145,6 +147,8 @@ const exampleData: ILapData[] = [
function RaceTab() {
const data = useMemo(() => exampleData, []);

const { currentPacket } = usePacket();

const table = useReactTable({
columns,
data,
Expand Down Expand Up @@ -191,6 +195,18 @@ function RaceTab() {
return (
<div className="m-4 flex justify-around">
<div className="mb-4 flex flex-col flex-wrap justify-end gap-2">
<div className="justify-left flex items-center gap-x-2 pb-2 pr-2">
<Image
alt="pfp"
className="rounded-full border-2 border-helios object-cover p-2"
height={50}
src="/assets/HeliosSideview.png"
width={50}
/>
<span className="text-sm">
Current Driver: {currentPacket.Pi.rfid}
</span>
</div>
{table.getAllLeafColumns().map((column) => (
<label className="flex items-center gap-1 text-sm" key={column.id}>
<input
Expand Down

0 comments on commit 82938e0

Please sign in to comment.