diff options
author | João Augusto Costa Branco Marado Torres <torres.dev@disroot.org> | 2025-06-24 12:08:41 -0300 |
---|---|---|
committer | João Augusto Costa Branco Marado Torres <torres.dev@disroot.org> | 2025-06-24 12:50:43 -0300 |
commit | f9a77c5c27aede4e5978eb55d9b7af781b680a1d (patch) | |
tree | d545e325ba1ae756fc2eac66fac1001b6753c40d /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.astro | 49 |
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} <{author.email}></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> |