updated links
This commit is contained in:
@@ -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>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user