forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentry-server.tsx
More file actions
37 lines (34 loc) · 1.13 KB
/
Copy pathentry-server.tsx
File metadata and controls
37 lines (34 loc) · 1.13 KB
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
31
32
33
34
35
36
37
// @refresh reload
import { createHandler, StartServer } from "@solidjs/start/server"
import { getRequestEvent } from "solid-js/web"
import { dir, localeFromRequest, tag } from "~/lib/language"
const criticalCSS = `[data-component="top"]{min-height:80px;display:flex;align-items:center}`
export default createHandler(
() => (
<StartServer
document={({ assets, children, scripts }) => {
const evt = getRequestEvent()
const locale = evt ? localeFromRequest(evt.request) : "en"
return (
<html lang={tag(locale)} dir={dir(locale)} data-locale={locale}>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta property="og:image" content="/social-share.png" />
<meta property="twitter:image" content="/social-share.png" />
<style>{criticalCSS}</style>
{assets}
</head>
<body>
<div id="app">{children}</div>
{scripts}
</body>
</html>
)
}}
/>
),
{
mode: "async",
},
)