All files / src index.tsx

100% Statements 21/21
100% Branches 0/0
100% Functions 7/7
100% Lines 14/14

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30      8x 2x 2x 1x 1x 1x 1x                     1x 1x 1x 1x 1x 1x 1x      
import React, { PropsWithChildren, type FC } from 'react';
import { HeadElement } from './elements/HeadElement';
 
const Internal: FC<PropsWithChildren> = ({ children }) => children;
const Title: FC<React.HTMLAttributes<HTMLTitleElement>> = (props) => <HeadElement {...props} as="title" />;
const Meta: FC<React.MetaHTMLAttributes<HTMLMetaElement>> = (props) => <HeadElement {...props} as="meta" />;
const Link: FC<React.LinkHTMLAttributes<HTMLLinkElement>> = (props) => <HeadElement {...props} as="link" />;
const Base: FC<React.BaseHTMLAttributes<HTMLBaseElement>> = (props) => <HeadElement {...props} as="base" />;
const Style: FC<React.StyleHTMLAttributes<HTMLStyleElement>> = (props) => <HeadElement {...props} as="style" />;
const Script: FC<React.ScriptHTMLAttributes<HTMLScriptElement>> = (props) => <HeadElement {...props} as="script" />;
 
type InternalComponent = typeof Internal & {
  Meta: typeof Meta;
  Title: typeof Title;
  Link: typeof Link;
  Base: typeof Base;
  Style: typeof Style;
  Script: typeof Script;
};
 
const Head: InternalComponent = Internal as InternalComponent;
Head.Meta = Meta;
Head.Title = Title;
Head.Link = Link;
Head.Base = Base;
Head.Style = Style;
Head.Script = Script;
 
export default Head;