mirror of
https://github.com/morten-olsen/morten-olsen.github.io.git
synced 2026-02-08 01:46:28 +01:00
init
This commit is contained in:
30
content/templates/react/components/html/index.tsx
Normal file
30
content/templates/react/components/html/index.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import { FC, ReactNode } from "react"
|
||||
|
||||
type HtmlProps = {
|
||||
body: ReactNode;
|
||||
head: ReactNode;
|
||||
scripts: string[];
|
||||
};
|
||||
|
||||
const Html: FC<HtmlProps> = ({ body, head, scripts }) => {
|
||||
return (
|
||||
<html>
|
||||
<head>
|
||||
<title>My App</title>
|
||||
{head}
|
||||
{scripts.map((script, index) => (
|
||||
<script key={index} src={script} />
|
||||
))}
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous"/>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Archivo+Black&family=Black+Ops+One&family=Merriweather:wght@400;700&display=swap" rel="stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="root">{body}</div>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
};
|
||||
|
||||
export { Html };
|
||||
Reference in New Issue
Block a user