+
+ {#if activity}
+ {@const patchFacts = (
+ [
+ activity.revisionCount > 0
+ ? {
+ icon: "revision" as IconName,
+ label: `${activity.revisionCount} ${pluralize("revision", activity.revisionCount)}`,
+ }
+ : undefined,
+ activity.commitCount > 0
+ ? {
+ icon: "commit" as IconName,
+ label: `${activity.commitCount} ${pluralize("commit", activity.commitCount)}`,
+ }
+ : undefined,
+ activity.reviewCount > 0
+ ? {
+ icon: "comment" as IconName,
+ label: `${activity.reviewCount} ${pluralize("review", activity.reviewCount)}`,
+ }
+ : undefined,
+ ] as ({ icon: IconName; label: string } | undefined)[]
+ ).filter(
+ (x): x is { icon: IconName; label: string } => x !== undefined,
+ )}
+ {@const repoFacts = (
+ [
+ activity.patchesAuthored > 0
+ ? {
+ icon: "patch" as IconName,
+ label: `${activity.patchesAuthored} ${pluralize("patch", activity.patchesAuthored)}`,
+ }
+ : undefined,
+ activity.issuesAuthored > 0
+ ? {
+ icon: "issue" as IconName,
+ label: `${activity.issuesAuthored} ${pluralize("issue", activity.issuesAuthored)}`,
+ }
+ : undefined,
+ ] as ({ icon: IconName; label: string } | undefined)[]
+ ).filter(
+ (x): x is { icon: IconName; label: string } => x !== undefined,
+ )}
+ {#if patchFacts.length > 0 || repoFacts.length > 0}
+
+ {#if patchFacts.length > 0}
+
+
+ On this patch
+
+ {#each patchFacts as item (item.label)}
+
+
+ {item.label}
+
+ {/each}
+
+ {/if}
+ {#if patchFacts.length > 0 && repoFacts.length > 0}
+
+ {/if}
+ {#if repoFacts.length > 0}
+
+
+ In this repo
+
+ {#each repoFacts as item (item.label)}
+
+
+ {item.label}
+
+ {/each}
+
+ {/if}
+
+ {/if}
+ {/if}
+
+
+ {/snippet}
+