feat: logo in satker and polda

This commit is contained in:
Sabda Yagra 2025-06-04 13:38:28 +07:00
parent 33566e012f
commit 84ef1dc935
1 changed files with 2 additions and 5 deletions

View File

@ -5,6 +5,7 @@ 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";
@ -12,9 +13,5 @@ export const DynamicLogoPolda = () => {
return "/logos/default-logo.svg";
};
return (
<div className="p-2">
<Image src={getLogoSrc()} alt="Logo" width={120} height={40} className="object-contain" />
</div>
);
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>;
};