18 lines
621 B
TypeScript
18 lines
621 B
TypeScript
"use client";
|
|
|
|
import Image from "next/image";
|
|
import { usePathname } from "next/navigation";
|
|
|
|
export const DynamicLogoPolda = () => {
|
|
const pathname = usePathname();
|
|
const polda = pathname?.split("/")[2];
|
|
|
|
const getLogoSrc = () => {
|
|
if (pathname?.startsWith("/polda/aceh")) return "/logo/polda/polda-aceh.png";
|
|
if (pathname?.startsWith("/user")) return "/logos/user-logo.svg";
|
|
return "/logos/default-logo.svg";
|
|
};
|
|
|
|
return <div className="p-2">{pathname?.includes("/polda") && <Image src={`/logo/polda/polda-${polda}.png`} alt="Logo" width={120} height={40} className="object-contain" />}</div>;
|
|
};
|