2026-01-07 14:44:01 +08:00
|
|
|
|
import { ImgHTMLAttributes } from 'react';
|
2026-01-16 14:36:24 +08:00
|
|
|
|
import { usePage } from '@inertiajs/react';
|
|
|
|
|
|
import { PageProps } from '@/types/global';
|
2026-01-07 14:44:01 +08:00
|
|
|
|
|
|
|
|
|
|
export default function ApplicationLogo(props: ImgHTMLAttributes<HTMLImageElement>) {
|
2026-01-16 14:36:24 +08:00
|
|
|
|
const { branding } = usePage<PageProps>().props;
|
|
|
|
|
|
|
|
|
|
|
|
// 如果有自訂 Logo,優先使用
|
|
|
|
|
|
if (branding?.logo_url) {
|
|
|
|
|
|
return (
|
|
|
|
|
|
<img
|
|
|
|
|
|
{...props}
|
|
|
|
|
|
src={branding.logo_url}
|
|
|
|
|
|
alt="Logo"
|
|
|
|
|
|
/>
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 預設 Logo
|
2026-01-07 14:44:01 +08:00
|
|
|
|
return (
|
|
|
|
|
|
<img
|
|
|
|
|
|
{...props}
|
|
|
|
|
|
src="/logo.png"
|
|
|
|
|
|
alt="小小冰室 Logo"
|
|
|
|
|
|
/>
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|