Skip to content

Commit

Permalink
Fix svelte lint error, removed enum from Image.svelte as they are not…
Browse files Browse the repository at this point in the history
… supported in Svelte components
  • Loading branch information
Polleps authored and joepio committed Nov 11, 2024
1 parent 199e1e8 commit 64d8e1e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions browser/svelte/src/lib/components/Image/Image.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
type SizeIndication,
} from './imageHelpers.js';
enum Support {
Full,
Basic,
None,
}
const Support = {
FULL: 0,
BASIC: 1,
NONE: 2,
};
interface Props extends HTMLImgAttributes {
subject: string;
Expand All @@ -38,13 +38,13 @@
let support = $derived.by(() => {
if (imageFormatsWithFullSupport.has(resource.props.mimetype ?? '')) {
return Support.Full;
return Support.FULL;
} else if (
imageFormatsWithBasicSupport.has(resource.props.mimetype ?? '')
) {
return Support.Basic;
return Support.BASIC;
} else {
return Support.None;
return Support.NONE;
}
});
Expand All @@ -55,9 +55,9 @@
<p>{resource.error.message}</p>
{:else if resource.loading}
<p>Loading...</p>
{:else if support === Support.None}
{:else if support === Support.NONE}
<p>Image format not supported</p>
{:else if support === Support.Basic}
{:else if support === Support.BASIC}
<img
src={resource.props.downloadUrl}
class:base-styles={!noBaseStyles}
Expand All @@ -66,7 +66,7 @@
width={resource.props.imageWidth}
{...restProps}
/>
{:else if support === Support.Full}
{:else if support === Support.FULL}
<picture>
<source
srcSet={toSrcSet('avif', quality, DEFAULT_SIZES)}
Expand Down

0 comments on commit 64d8e1e

Please sign in to comment.