Skip to content

Commit

Permalink
fix: Correct type usage and add missing key props
Browse files Browse the repository at this point in the history
- fix: Remove unused `Location` type import.
- fix: Add missing `key` props to ensure proper rendering.
- refactor: Replace `location` with `locationName` for consistency.
  • Loading branch information
Sampiiiii committed Oct 7, 2024
1 parent 1046f68 commit 5505ccd
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useAuth } from "@/components/auth-provider";
import { InfractionSection } from "@/routes/_authenticated/_reponly/signin/dashboard/-components/SignedInUserCard/InfractionSection.tsx";
import { TeamManagementSection } from "@/routes/_authenticated/_reponly/signin/dashboard/-components/SignedInUserCard/TeamManagementSection.tsx";
import { TrainingSection } from "@/routes/_authenticated/_reponly/signin/dashboard/-components/SignedInUserCard/TrainingSection.tsx";
import type { Location, LocationName } from "@ignis/types/sign_in.ts";
import type { LocationName } from "@ignis/types/sign_in.ts";
import { PartialUserWithTeams } from "@ignis/types/users.ts";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@ui/components/ui/tabs.tsx";
import posthog from "posthog-js";
Expand Down Expand Up @@ -62,12 +62,12 @@ export const ManageUserWidget: React.FC<ManageUserWidgetProps> = ({ user, locati
<Tabs className="w-full" defaultValue={ManageSectionList[0]}>
<TabsList className="w-full">
{ManageSectionList.filter((title) => canUserViewSection(roleNames, title)).map((title) => (
<TabsTrigger value={title}>{sectionHeadings[title]}</TabsTrigger>
<TabsTrigger value={title} key={title}>{sectionHeadings[title]}</TabsTrigger>
))}
</TabsList>
{ManageSectionList.filter((title) => canUserViewSection(roleNames, title)).map((title) => (
<TabsContent className="content-center justify-center" value={title}>
{sectionComponents[title]({ user: user, locationName: location, onShiftReps })}
<TabsContent className="content-center justify-center" value={title} key={title}>
{sectionComponents[title]({ user: user, locationName: locationName, onShiftReps })}
</TabsContent>
))}
</Tabs>
Expand Down

0 comments on commit 5505ccd

Please sign in to comment.