-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHeaderMenu.tsx
More file actions
37 lines (35 loc) · 1.05 KB
/
HeaderMenu.tsx
File metadata and controls
37 lines (35 loc) · 1.05 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
import type { FC } from "react";
export type HeaderMenuProps = {
canonicalUrl: string;
deploymentUrl: string;
};
export const HeaderMenu: FC<HeaderMenuProps> = ({
canonicalUrl,
deploymentUrl,
}) => {
const canonicalHostname = new URL(canonicalUrl).hostname;
const deploymentHostname = new URL(deploymentUrl).hostname;
return (
<header className="grid h-16 w-full grid-cols-2 grid-rows-1 place-items-center items-center border-b px-4 sm:grid-cols-1 lg:px-0">
<div className="flex h-full w-full max-w-5xl flex-col justify-center">
<a
href={deploymentUrl}
className="flex flex-row items-center text-md font-bold text-link underline"
>
{deploymentHostname}
</a>
{canonicalHostname !== deploymentHostname && (
<div>
speglar{" "}
<a
href={canonicalUrl}
className="text-md font-bold text-link underline"
>
{canonicalHostname}
</a>
</div>
)}
</div>
</header>
);
};