loading...
12}: {13 commit: {14 sha: string;15 message: string;16 author: { id?: string; name: string; email: string };17 date: string;18 };19 isSelected: boolean;20 href: string;12}: {13 commit: {14 sha: string;15 message: string;16 author: string | { id?: string; name: string; email: string };17 date: string;18 };19 isSelected: boolean;20 href34 <div className="flex flex-col w-full justify-start items-start min-w-0">35 <div className="text-sm truncate mb-0.5 w-full">{commit.message}</div>3637 <div className="text-xs text-muted-foreground flex items-center gap-1 w-full min-w-0">38 <span className="truncate min-w-0">{commit.author.name}</span>39 href,40}: {41 entry: RepositoryTreeEntry;42 href: string;43}) {..44 return (45 <Link46 className="grid grid-cols-[1fr_300px_150px] w-full pl-2 h-9 items-center border-b hover:bg-accent/50 select-none cursor-default text-sm"47 href={href}39 href,40}: {41 entry: RepositoryTreeEntry;42 href: string;43 }) {44 const author = typeof entry.commit.author === "string" ? entry.commit.author : entry.commit.author.name;4546 return (47 <Link48 className="grid grid-cols-[1fr_300px_150px] w-full pl-2 h-9 items-center border-b hover:bg-accent/50 select-none cursor-default text-sm"58 </span>59 </span>60 <span className="truncate">{entry.commit.message}</span>61 <span className="text-primary/60 ml-4 whitespace-nowrap">62 {entry.commit.author.name} • {timeAgo(new Date(entry.commit.date10 diffs: RepositoryFileDiff[];11}) {12 const midpoint = Math.ceil(diffs.length / 2);13 const leftColumn = diffs.slice(0, midpoint);14 const rightColumn = diffs.slice(midpoint);..1516 const renderDiffItem = (diff: RepositoryFileDiff) => {17 const path = diff.left?.path || diff.right?.path || "";18 return (10 diffs: RepositoryFileDiff[];11}) {12 const midpoint = Math.ceil(diffs.length / 2);13 const leftColumn = diffs.slice(0, midpoint);14 const rightColumn = diffs.slice(midpoint);15 const author = typeof commit.author31 return (32 <div className="shrink-0 border-border border-b p-2">33 <div className="mb-4">34 <div className="flex items-center gap-1 text-xs text-muted-foreground mb-1">35 <span>{commit.author.name}</span>36 <span>•</span>37 <span>36 <div className="text-sm truncate mb-0.5 w-full">37 {commit.message}38 </div>39 <div className="text-xs text-muted-foreground flex items-center gap-1 w-full min-w-0">40 <span className="truncate min-w-0">{commit.author.name}</span>41 <span className="shrink-0">•</span>42 <span className="shrink-0">43 {formatTime(new Date(commit.date))}44 </span>36 <div className="text-sm truncate mb-0.5 w-full">37 {commit.message}38 </div>39 <div className="text-xs text-muted-foreground flex items-center gap-1 w-full min-w-0">40 <span className="truncate min-w-0">{typeof commit.author === "string" ? commit.author : 32 {formatDateKey(date)}33 </h3>34 </div>35 {dateCommits.map((commit) => {36 const isActive = currentSha === commit.sha.substring(0, 7);..37 return (38 <Link39 key={commit.sha}40 href={`/${owner}/${repo}/commits/${commit.sha.substring(0, 7)}`}32 {formatDateKey(date)}33 </h3>34 </div>35 {dateCommits.map((commit) => {36 const isActive = currentSha === commit.sha.substring(0, 7);37 const author = typeof commit.author === "47 <div className="text-sm truncate mb-0.5 w-full">48 {commit.message}49 </div>50 <div className="text-xs text-muted-foreground flex items-center gap-1 w-full min-w-0">51 <span className="truncate min-w-0">{commit.author.name}</span>52 <span className42export const RepositoryCommitSchema = z.object({43 sha: z.string(),44 message: z.string(),45 date: z.iso.datetime(),46 author: CommitAuthorSchema,47});4849export type RepositoryCommit = z.infer<typeof RepositoryCommitSchema>;5042export const RepositoryCommitSchema = z.object({43 sha: z.string(),44 message: z.string(),45 date: z.iso.datetime(),46 author: z.string().or(CommitAuthorSchema),47});48:
string
;
39 <span className="shrink-0">•</span>
40 <span className="shrink-0">{commit.sha.substring(0, 7)}</span>
41 <span className="ml-auto shrink-0">
42 {timeAgo(new Date(commit.date))}
36 <div className="flex flex-col w-full justify-start items-start min-w-0">37 <div className="text-sm truncate mb-0.5 w-full">{commit.message}</div>3839 <div className="text-xs text-muted-foreground flex items-center gap-1 w-full min-w-0">40 <span className="truncate min-w-0">{author}</span>41 <span className="shrink-0">•</span>42 <span className="shrink-0">{commit.sha.substring(0, 7)}</span>43 <span className="ml-auto shrink-0">44 {timeAgo(new Date(commit.date))}))
}
63 </span>
64 </Link>
65 );
66}
60 </span>61 </span>62 <span className="truncate">{entry.commit.message}</span>63 <span className="text-primary/60 ml-4 whitespace-nowrap">64 {author} • {timeAgo(new Date(entry.commit.date))}65 </span>66 </Link>67 );68} ===
"
string
"
?
commit
.
author
:
commit
.
author
.
name
;
16
17 const renderDiffItem = (diff: RepositoryFileDiff) => {
18 const path = diff.left?.path || diff.right?.path || "";
19 return (
{
formatDateTime
(
new
Date
(
commit
.
date
))
}
</span>
38 </div>
39 <div className="text-sm text-primary">{commit.message}</div>
32 return (33 <div className="shrink-0 border-border border-b p-2">34 <div className="mb-4">35 <div className="flex items-center gap-1 text-xs text-muted-foreground mb-1">36 <span>{author}</span>37 <span>•</span>38 <span>{formatDateTime(new Date(commit.date))}</span>39 </div>40 <div className="text-sm text-primary">{commit.message}</div>commit
.
author
.
name
}
</span>
41 <span className="shrink-0">•</span>
42 <span className="shrink-0">
43 {formatTime(new Date(commit.date))}
44 </span>
string
"
?
commit
.
author
:
commit
.
author
.
name
;
38 return (
39 <Link
40 key={commit.sha}
41 href={`/${owner}/${repo}/commits/${commit.sha.substring(0, 7)}`}
=
"
shrink-0
"
>
•
</span>
53 <span className="shrink-0">
54 {formatTime(new Date(commit.date))}
55 </span>
48 <div className="text-sm truncate mb-0.5 w-full">49 {commit.message}50 </div>51 <div className="text-xs text-muted-foreground flex items-center gap-1 w-full min-w-0">52 <span className="truncate min-w-0">{author}</span>53 <span className="shrink-0">•</span>54 <span className="shrink-0">55 {formatTime(new Date(commit.date))}56 </span>49export type RepositoryCommit = z.infer<typeof RepositoryCommitSchema>;
50