"use client";

import React from "react";
import { usePathname } from "next/navigation";
import { SidebarMenuSubButton } from "@/components/ui/sidebar";
import Link from "next/link";

function SidebarLink({ url, title }: { url: string; title: string }) {
  const isActive = usePathname() === url;
  return (
    <SidebarMenuSubButton asChild isActive={isActive}>
      <Link href={url}>{title}</Link>
    </SidebarMenuSubButton>
  );
}

export default SidebarLink;
