+
+
+
+
+ {`${url.hostname}${url.pathname === "/" ? "" : url.pathname}`}
+
+
+
+
+
diff --git a/src/components/Homepage/Homepage.stories.ts b/src/components/Homepage/Homepage.stories.ts
new file mode 100644
index 0000000..5cffc9c
--- /dev/null
+++ b/src/components/Homepage/Homepage.stories.ts
@@ -0,0 +1,11 @@
+import Homepage from "./Homepage.astro";
+import * as stories from "./story.ts";
+
+export default {
+ title: "Homepage",
+ component: Homepage,
+};
+
+export const Domain = { args: stories.Domain };
+export const Path = { args: stories.Path };
+export const Japanese = { args: stories.Japanese };
diff --git a/src/components/Homepage/Homepage.test.ts b/src/components/Homepage/Homepage.test.ts
new file mode 100644
index 0000000..613f3bf
--- /dev/null
+++ b/src/components/Homepage/Homepage.test.ts
@@ -0,0 +1,23 @@
+import { experimental_AstroContainer as AstroContainer } from "astro/container";
+import { describe, expect, test } from "vitest";
+
+import Homepage from "./Homepage.astro";
+import * as stories from "./story.ts";
+
+describe("Homepage", () => {
+ for (const [name, props] of Object.entries(stories)) {
+ test(name, async () => {
+ const container: AstroContainer = await AstroContainer.create();
+ const result: string = await container.renderToString(Homepage, {
+ props,
+ });
+ const url = new URL(props.url);
+
+ expect(result).toContain(
+ `> ${encodeURI(url.hostname)}${
+ url.pathname === "/" ? "" : url.pathname
+ } `,
+ );
+ });
+ }
+});
diff --git a/src/components/Homepage/story.ts b/src/components/Homepage/story.ts
new file mode 100644
index 0000000..0b3fc24
--- /dev/null
+++ b/src/components/Homepage/story.ts
@@ -0,0 +1,5 @@
+import type { Props } from "./Homepage.astro";
+
+export const Domain: Props = { url: "https://example.com" };
+export const Path: Props = { url: "https://www.example.com/path" };
+export const Japanese: Props = { url: "https://www.example.com/パス" };
diff --git a/src/libs/qrcode.ts b/src/libs/qrcode.ts
new file mode 100644
index 0000000..cd63edc
--- /dev/null
+++ b/src/libs/qrcode.ts
@@ -0,0 +1,8 @@
+import QRCode from "qrcode";
+
+export const generateQRCode = async (url: string): Promise