From 98abcc023b99898f3a7e182e2330ea809a4c99e2 Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Sun, 12 Jan 2025 19:43:59 +0900
Subject: refactor(blog/nuldoc): convert components/*.ts to TSX

---
 vhosts/blog/nuldoc-src/components/StaticScript.tsx | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 vhosts/blog/nuldoc-src/components/StaticScript.tsx

(limited to 'vhosts/blog/nuldoc-src/components/StaticScript.tsx')

diff --git a/vhosts/blog/nuldoc-src/components/StaticScript.tsx b/vhosts/blog/nuldoc-src/components/StaticScript.tsx
new file mode 100644
index 00000000..eb26ada7
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/components/StaticScript.tsx
@@ -0,0 +1,17 @@
+import { join } from "std/path/mod.ts";
+import { Config } from "../config.ts";
+import { calculateFileHash } from "./utils.ts";
+
+export default async function StaticScript(
+  { fileName, type, config }: {
+    fileName: string;
+    type?: string;
+    config: Config;
+  },
+) {
+  const filePath = join(Deno.cwd(), config.locations.staticDir, fileName);
+  const hash = await calculateFileHash(filePath);
+  return (
+    <script src={`${fileName}?h=${hash}`} {...(type ? { type } : {})}></script>
+  );
+}
-- 
cgit v1.2.3-70-g09d2

