From 620d251c5e176bb06dcb0f17da04febe1b0282e5 Mon Sep 17 00:00:00 2001
From: Claude
Date: Fri, 24 Apr 2026 17:28:24 +0000
Subject: [PATCH] Allow competition admins to edit props from the competition
prop page
The prop update server action already permits competition admins via
RLS, but the competition prop view only rendered the edit dialog for
system admins and never exposed a button to open it. Add a visible
Edit button in the prop header and broaden the isAdmin check to
include users with the "admin" role in the competition.
---
.../props/[propId]/competition-prop-view.tsx | 13 ++++++++-
.../[competitionId]/props/[propId]/page.tsx | 29 +++++++++----------
2 files changed, 26 insertions(+), 16 deletions(-)
diff --git a/app/competitions/[competitionId]/props/[propId]/competition-prop-view.tsx b/app/competitions/[competitionId]/props/[propId]/competition-prop-view.tsx
index 1dd1dde..1e27598 100644
--- a/app/competitions/[competitionId]/props/[propId]/competition-prop-view.tsx
+++ b/app/competitions/[competitionId]/props/[propId]/competition-prop-view.tsx
@@ -3,7 +3,7 @@
import { useState, useRef } from "react";
import { useRouter } from "next/navigation";
import Link from "next/link";
-import { ChevronRight, Calendar, CalendarClock, Lock } from "lucide-react";
+import { ChevronRight, Calendar, CalendarClock, Lock, Pencil } from "lucide-react";
import { PropWithUserForecast } from "@/types/db_types";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
@@ -253,6 +253,17 @@ export function CompetitionPropView({