summaryrefslogtreecommitdiff
path: root/Hutch/Views/Repositories/CommitRowView.swift
blob: b5eb31db5e66e96028b4c048ca3419ca6f14f5c1 (plain) (blame)
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
import SwiftUI

struct CommitRowView: View {
    let commit: CommitSummary

    var body: some View {
        VStack(alignment: .leading, spacing: 4) {
            Text(commit.title)
                .font(.subheadline)
                .lineLimit(1)

            HStack(spacing: 8) {
                Text(commit.shortId)
                    .font(.caption.monospaced())
                    .foregroundStyle(.secondary)

                Text(commit.author.name)
                    .font(.caption)
                    .foregroundStyle(.secondary)

                Spacer()

                Text(commit.author.time.relativeDescription)
                    .font(.caption)
                    .foregroundStyle(.tertiary)
            }
        }
        .padding(.vertical, 2)
    }
}