mirror of
https://github.com/thatmattlove/hyperglass.git
synced 2026-01-17 08:48:05 +00:00
11 lines
432 B
TypeScript
11 lines
432 B
TypeScript
import type { Favicon as FaviconProps } from '~/types';
|
|
|
|
/**
|
|
* Render a `<link/>` element to reference a server-side favicon.
|
|
*/
|
|
export const Favicon = (props: FaviconProps): JSX.Element => {
|
|
const { image_format, dimensions, prefix, rel } = props;
|
|
const [w, h] = dimensions;
|
|
const src = `/images/favicons/${prefix}-${w}x${h}.${image_format}`;
|
|
return <link rel={rel ?? ''} href={src} type={`image/${image_format}`} />;
|
|
};
|