mirror of
https://github.com/KuekHaoYang/KVideo.git
synced 2026-07-01 01:14:18 +08:00
20 lines
401 B
TypeScript
20 lines
401 B
TypeScript
'use client';
|
|
|
|
import { createContext, useContext } from 'react';
|
|
|
|
const SiteIconContext = createContext('/icon.png');
|
|
|
|
export function SiteIconProvider({
|
|
children,
|
|
iconSrc,
|
|
}: {
|
|
children: React.ReactNode;
|
|
iconSrc: string;
|
|
}) {
|
|
return <SiteIconContext.Provider value={iconSrc}>{children}</SiteIconContext.Provider>;
|
|
}
|
|
|
|
export function useSiteIcon() {
|
|
return useContext(SiteIconContext);
|
|
}
|