refac
This commit is contained in:
1 parent
31c1ffd55a
commit
f8c5fda283
1 file changed
+8
-3
@@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
let failed = false;
|
let failed = false;
|
||||||
let attemptedSrc = '';
|
let attemptedSrc = '';
|
||||||
|
$: compactUnavailable = /(?:^|\s)(?:size-|w-|h-)/.test(imageClassName);
|
||||||
$: if (_src !== attemptedSrc) {
|
$: if (_src !== attemptedSrc) {
|
||||||
attemptedSrc = _src;
|
attemptedSrc = _src;
|
||||||
failed = false;
|
failed = false;
|
||||||
@@ -50,11 +51,15 @@
|
|||||||
<div class=" relative group w-fit flex items-center">
|
<div class=" relative group w-fit flex items-center">
|
||||||
{#if failed}
|
{#if failed}
|
||||||
<div
|
<div
|
||||||
class="{imageClassName} flex items-center gap-2 px-3 py-2.5 border border-dashed border-gray-200 dark:border-gray-800 text-gray-400 dark:text-gray-600"
|
class="{imageClassName} inline-flex {compactUnavailable
|
||||||
|
? ''
|
||||||
|
: 'h-[1.6875rem] min-w-8 gap-1.5 px-2'} items-center justify-center overflow-hidden border border-gray-100/50 bg-gray-50/40 text-gray-500 dark:border-white/[0.04] dark:bg-white/[0.03] dark:text-gray-400"
|
||||||
data-cy="image-unavailable"
|
data-cy="image-unavailable"
|
||||||
>
|
>
|
||||||
<Photo className="size-4 shrink-0" strokeWidth="1.5" />
|
<Photo className="size-3.5 shrink-0" strokeWidth="1.5" />
|
||||||
<span class="text-xs">{$i18n.t('Image unavailable')}</span>
|
<span class:hidden={compactUnavailable} class="truncate text-xs">
|
||||||
|
{$i18n.t('Image unavailable')}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
<button
|
<button
|
||||||
|
|||||||
Reference in new issue
Block a user