Files
vod-system/frontend/src/components/buttons/SidebarButton.tsx
Dylan De Faoite 3db16cd380
All checks were successful
CI / Maven unit tests (push) Successful in 14s
CI / Build and push images (push) Successful in 4m17s
CI / Deploy to server (push) Successful in 1m9s
feat(style): update fonts & themes in frontend (#14)
Reviewed-on: https://gitea.vodsystem.ddns.net/dylan/vod-system/pulls/14
2026-08-16 16:17:41 +01:00

29 lines
811 B
TypeScript

import { Link, useLocation } from "react-router-dom";
import React from "react";
type Props = {
url: string;
logo: React.ReactNode;
label: string;
}
const SidebarButton = ({url, logo, label}: Props) => {
const { pathname } = useLocation();
const isActive = url === "/" ? pathname === "/" : pathname.startsWith(url);
return (
<Link className="w-full" to={url}>
<button className={`flex items-center gap-2.5 w-full text-sm
font-body p-2 hover:bg-hover hover:text-text-strong
rounded-md
${isActive ?
"bg-card text-text-strong font-medium shadow-sm"
:
"text-text-primary"}`}>
{logo}{label}
</button>
</Link>
)
}
export default SidebarButton;