|
371 | 371 | {:else if selectedTab === ''} |
372 | 372 | {#if item?.file?.data} |
373 | 373 | {@const rawContent = (item?.file?.data?.content ?? '').trim() || 'No content'} |
374 | | - {@const isTruncated = ($settings?.renderMarkdownInPreviews ?? true) && rawContent.length > CONTENT_PREVIEW_LIMIT && !expandedContent} |
| 374 | + {@const isTruncated = |
| 375 | + ($settings?.renderMarkdownInPreviews ?? true) && |
| 376 | + rawContent.length > CONTENT_PREVIEW_LIMIT && |
| 377 | + !expandedContent} |
375 | 378 | {#if $settings?.renderMarkdownInPreviews ?? true} |
376 | | - <div class="max-h-96 overflow-scroll scrollbar-hidden text-sm prose dark:prose-invert max-w-full"> |
377 | | - <Markdown content={isTruncated ? rawContent.slice(0, CONTENT_PREVIEW_LIMIT) : rawContent} id="file-preview" /> |
| 379 | + <div |
| 380 | + class="max-h-96 overflow-scroll scrollbar-hidden text-sm prose dark:prose-invert max-w-full" |
| 381 | + > |
| 382 | + <Markdown |
| 383 | + content={isTruncated ? rawContent.slice(0, CONTENT_PREVIEW_LIMIT) : rawContent} |
| 384 | + id="file-preview" |
| 385 | + /> |
378 | 386 | </div> |
379 | 387 | {#if isTruncated} |
380 | 388 | <button |
381 | 389 | class="mt-1 text-xs text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 transition" |
382 | | - on:click={() => { expandedContent = true; }} |
| 390 | + on:click={() => { |
| 391 | + expandedContent = true; |
| 392 | + }} |
383 | 393 | > |
384 | | - {$i18n.t('Show all ({{COUNT}} characters)', { COUNT: rawContent.length.toLocaleString() })} |
| 394 | + {$i18n.t('Show all ({{COUNT}} characters)', { |
| 395 | + COUNT: rawContent.length.toLocaleString() |
| 396 | + })} |
385 | 397 | </button> |
386 | 398 | {/if} |
387 | 399 | {:else} |
|
391 | 403 | {/if} |
392 | 404 | {:else if item?.content} |
393 | 405 | {@const rawContent = (item?.content ?? '').trim() || 'No content'} |
394 | | - {@const isTruncated = ($settings?.renderMarkdownInPreviews ?? true) && rawContent.length > CONTENT_PREVIEW_LIMIT && !expandedContent} |
| 406 | + {@const isTruncated = |
| 407 | + ($settings?.renderMarkdownInPreviews ?? true) && |
| 408 | + rawContent.length > CONTENT_PREVIEW_LIMIT && |
| 409 | + !expandedContent} |
395 | 410 | {#if $settings?.renderMarkdownInPreviews ?? true} |
396 | | - <div class="max-h-96 overflow-scroll scrollbar-hidden text-sm prose dark:prose-invert max-w-full"> |
397 | | - <Markdown content={isTruncated ? rawContent.slice(0, CONTENT_PREVIEW_LIMIT) : rawContent} id="file-preview-content" /> |
| 411 | + <div |
| 412 | + class="max-h-96 overflow-scroll scrollbar-hidden text-sm prose dark:prose-invert max-w-full" |
| 413 | + > |
| 414 | + <Markdown |
| 415 | + content={isTruncated ? rawContent.slice(0, CONTENT_PREVIEW_LIMIT) : rawContent} |
| 416 | + id="file-preview-content" |
| 417 | + /> |
398 | 418 | </div> |
399 | 419 | {#if isTruncated} |
400 | 420 | <button |
401 | 421 | class="mt-1 text-xs text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 transition" |
402 | | - on:click={() => { expandedContent = true; }} |
| 422 | + on:click={() => { |
| 423 | + expandedContent = true; |
| 424 | + }} |
403 | 425 | > |
404 | | - {$i18n.t('Show all ({{COUNT}} characters)', { COUNT: rawContent.length.toLocaleString() })} |
| 426 | + {$i18n.t('Show all ({{COUNT}} characters)', { |
| 427 | + COUNT: rawContent.length.toLocaleString() |
| 428 | + })} |
405 | 429 | </button> |
406 | 430 | {/if} |
407 | 431 | {:else} |
|
0 commit comments