// AdCard.js
import { Link } from "react-router-dom";

export default function AdCard({ ad }) {
    return (
      <div className="col-lg-4 p-4 gx-4 gy-4">
        <Link to={`/ad/${ad.slug}`} className="nav-link">
          {/* rest of content */}
        </Link>
      </div>
    );
  }

Create a page and grab slug from route params

// pages/AdView.js
import { useParams } from "react-router-dom";

export default function AdView() {
  const params = useParams();
  return <>{params.slug}</>;
}
// App.js
<Route path="/ad/:slug" element={<AdView />} />