|
73 | 73 | let repo = $derived(info.html_url?.replace("https://github.com/", "").split("/")[1] ?? ""); |
74 | 74 | let type = $derived.by(() => { |
75 | 75 | if (!info.html_url) return "issue" as const; |
76 | | - return ( |
77 | | - info.html_url.replace("https://github.com/", "").split("/")[2] === "pull" ? "pull" : "issue" |
78 | | - ) as const; |
| 76 | + return info.html_url.replace("https://github.com/", "").split("/")[2] === "pull" |
| 77 | + ? ("pull" as const) |
| 78 | + : ("issue" as const); |
79 | 79 | }); |
80 | 80 |
|
81 | 81 | let rightPartInfo = $derived.by(() => { |
|
125 | 125 | <h3 class="text-2xl font-semibold tracking-tight"> |
126 | 126 | {type === "pull" ? "Closing issue" : "Development PR"}{linkedEntities.length > 1 ? "s" : ""} |
127 | 127 | </h3> |
128 | | - <Accordion.Root class="mb-12"> |
| 128 | + <Accordion.Root type="single" class="mb-12"> |
129 | 129 | {#each linkedEntities as entity} |
130 | 130 | <Accordion.Item value={entity.number.toString()}> |
131 | 131 | <Accordion.Trigger class="group hover:no-underline [&>svg:last-child]:flex-shrink-0"> |
|
145 | 145 | <div |
146 | 146 | class="mr-4 flex flex-shrink-0 flex-col items-end gap-1 text-right text-sm text-muted-foreground xs:ml-auto xs:flex-row xs:items-center" |
147 | 147 | > |
148 | | - <div class="flex items-center gap-2"> |
149 | | - <Avatar.Root class="size-6"> |
150 | | - <Avatar.Image src={entity.author.avatarUrl} alt={entity.author.login} /> |
151 | | - <Avatar.Fallback> |
152 | | - {entity.author.login.charAt(0).toUpperCase()} |
153 | | - </Avatar.Fallback> |
154 | | - </Avatar.Root> |
155 | | - <span class="font-semibold">{entity.author.login}</span> |
156 | | - </div> |
157 | | - <span class="hidden xs:block">•</span> |
158 | | - <span>{formatToDateTime(entity.createdAt)}</span> |
| 148 | + {#if "author" in entity} |
| 149 | + <div class="flex items-center gap-2"> |
| 150 | + <Avatar.Root class="size-6"> |
| 151 | + <Avatar.Image src={entity.author?.avatarUrl} alt={entity.author?.login} /> |
| 152 | + <Avatar.Fallback> |
| 153 | + {entity.author?.login.charAt(0).toUpperCase()} |
| 154 | + </Avatar.Fallback> |
| 155 | + </Avatar.Root> |
| 156 | + <span class="font-semibold">{entity.author?.login}</span> |
| 157 | + </div> |
| 158 | + <span class="hidden xs:block">•</span> |
| 159 | + {/if} |
| 160 | + {#if "createdAt" in entity} |
| 161 | + <span>{formatToDateTime(entity.createdAt)}</span> |
| 162 | + {/if} |
159 | 163 | </div> |
160 | 164 | </div> |
161 | 165 | </Accordion.Trigger> |
162 | 166 | <!-- Body --> |
163 | 167 | <Accordion.Content class="mx-auto sm:w-3/4"> |
164 | 168 | <MarkdownRenderer |
165 | | - markdown={entity.body} |
| 169 | + markdown={entity.body || "_No description provided_"} |
166 | 170 | parseRawHtml |
167 | 171 | class="max-w-full text-base" |
168 | 172 | additionalPlugins={[shikiPlugin]} |
|
0 commit comments