summaryrefslogtreecommitdiff
path: root/src/components/Commit.astro
diff options
context:
space:
mode:
authorJoão Augusto Costa Branco Marado Torres <torres.dev@disroot.org>2025-06-24 12:08:41 -0300
committerJoão Augusto Costa Branco Marado Torres <torres.dev@disroot.org>2025-06-24 12:50:43 -0300
commitf9a77c5c27aede4e5978eb55d9b7af781b680a1d (patch)
treed545e325ba1ae756fc2eac66fac1001b6753c40d /src/components/Commit.astro
feat!: initial commit
Signed-off-by: João Augusto Costa Branco Marado Torres <torres.dev@disroot.org>
Diffstat (limited to 'src/components/Commit.astro')
-rw-r--r--src/components/Commit.astro49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/components/Commit.astro b/src/components/Commit.astro
new file mode 100644
index 0000000..3ee284a
--- /dev/null
+++ b/src/components/Commit.astro
@@ -0,0 +1,49 @@
+---
+import type { Commit } from "@lib/git/types";
+import { gitDir } from "@lib/git";
+
+type Props = Commit;
+
+const { hash, files, author, signature } = Astro.props;
+
+const git = await gitDir;
+---
+<p>Git commit info:</p>
+<dl>
+ <dt>Hash</dt>
+ <dd>{hash}</dd>
+ <dt>Files</dt>
+ {files.map((file) => <dd>{file.pathname.replace(git, "")}</dd>)}
+ <dt>Author</dt>
+ <dd>{author.name} &lt;{author.email}&gt;</dd>
+ {
+ signature && (
+ <dt>Commit Signature</dt>
+ <dd>
+ <dl>
+ <dt>Type</dt>
+ <dd>{signature.type}</dd>
+ <dt>Signer</dt>
+ <dd>{signature.signerName}</dd>
+ <dt>Key fingerprint</dt>
+ <dd>{signature.keyFingerPrint}</dd>
+ </dl>
+ </dd>
+ )
+ }
+</dl>
+
+<style>
+ dl {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ }
+
+ dl > dt, dd {
+ display: inline-block;
+ }
+
+ dt::after {
+ content: ": ";
+ }
+</style>