1
0
Fork 1
mirror of https://github.com/thatmattlove/hyperglass.git synced 2026-01-17 08:48:05 +00:00
thatmattlove-hyperglass/hyperglass/ui/elements/favicon.tsx
2021-12-19 22:57:00 -07:00

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}`} />;
};