作为 OIDC Provider 对接 Gitea;注册支持邮件验证码/验证码;侧栏同步公开仓库;Feed 分页、文章大纲、标签云与站点品牌设置。 Co-authored-by: Cursor <cursoragent@cursor.com>
27 lines
752 B
TypeScript
27 lines
752 B
TypeScript
import type { SiteBranding } from '../api/types';
|
||
import { cn } from '@/lib/utils';
|
||
|
||
interface Props {
|
||
branding: SiteBranding;
|
||
/** CSS 类:header-logo-mark / logo-mark / admin-topbar-mark */
|
||
className?: string;
|
||
/** 有 Logo 图时用的额外类名 */
|
||
imgClassName?: string;
|
||
}
|
||
|
||
/** 站点字标或 Logo 图 */
|
||
export default function SiteBrandMark({ branding, className, imgClassName }: Props) {
|
||
if (branding.logo) {
|
||
return (
|
||
<img
|
||
src={branding.logo}
|
||
alt={branding.name}
|
||
className={cn(className, 'site-brand-logo-img', imgClassName)}
|
||
loading="lazy"
|
||
decoding="async"
|
||
/>
|
||
);
|
||
}
|
||
return <span className={className}>{branding.logo_mark || branding.name.charAt(0) || '?'}</span>;
|
||
}
|