updated links

This commit is contained in:
jackiettran
2025-11-07 13:34:24 -05:00
parent 066ad4a3fe
commit e20e33a0f6
4 changed files with 38 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
import React, { useState, useEffect } from "react";
import { Link } from "react-router-dom";
import { Link, useNavigate } from "react-router-dom";
import { useAuth } from "../contexts/AuthContext";
import { rentalAPI, conditionCheckAPI } from "../services/api";
import { Rental } from "../types";
@@ -38,6 +38,7 @@ const Renting: React.FC = () => {
};
const { user } = useAuth();
const navigate = useNavigate();
const [rentals, setRentals] = useState<Rental[]>([]);
const [loading, setLoading] = useState(true);
const [error, setError] = useState<string | null>(null);
@@ -282,8 +283,13 @@ const Renting: React.FC = () => {
{rental.owner && (
<p className="mb-1 text-dark">
<strong>Owner:</strong> {rental.owner.firstName}{" "}
{rental.owner.lastName}
<strong>Owner:</strong>{" "}
<span
onClick={() => navigate(`/users/${rental.ownerId}`)}
style={{ cursor: "pointer" }}
>
{rental.owner.firstName} {rental.owner.lastName}
</span>
</p>
)}