feat: vistas y botones de tickets solo para equipo
This commit is contained in:
1 parent
85fcabd5a5
commit
2594c6a315
2 files changed
+14
-2
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import { useParams } from "next/navigation";
|
||||
import { useAuth } from "@/lib/auth";
|
||||
import {
|
||||
getTicket,
|
||||
getComments,
|
||||
@@ -30,6 +31,8 @@ const STATUS_OPTIONS = [
|
||||
export default function TicketDetailPage() {
|
||||
const params = useParams();
|
||||
const id = Number(params.id);
|
||||
const { user } = useAuth();
|
||||
const isTeam = user?.role === "admin" || user?.role === "agent";
|
||||
|
||||
const [ticket, setTicket] = useState<Ticket | null>(null);
|
||||
const [comments, setComments] = useState<Comment[]>([]);
|
||||
@@ -165,6 +168,7 @@ export default function TicketDetailPage() {
|
||||
<BadgePriority priority={ticket.priority} />
|
||||
</div>
|
||||
</div>
|
||||
{isTeam && (
|
||||
<div className="d-flex gap-2">
|
||||
{/* Status Change (dropdown controlado por React: sin bootstrap.js) */}
|
||||
<div className="position-relative">
|
||||
@@ -262,6 +266,7 @@ export default function TicketDetailPage() {
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{error && (
|
||||
|
||||
Reference in new issue
Block a user