Skip to content

Commit

Permalink
fix Svelte 5 SSR markup warning
Browse files Browse the repository at this point in the history
  • Loading branch information
kenkunz committed Dec 9, 2024
1 parent 7b2daaf commit d1410ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
<script lang="ts">
import type { ComponentProps } from 'svelte';
import type { ComponentProps, Snippet } from 'svelte';
import { DataBadge, Tooltip } from '$lib/components';
export let label: string;
export let title: string;
export let status: ComponentProps<DataBadge>['status'] = 'default';
type Props = {
label: string;
title: string;
status?: ComponentProps<DataBadge>['status'];
children: Snippet;
};
let { label, title, status = 'default', children }: Props = $props();
</script>

<Tooltip>
Expand All @@ -14,7 +19,7 @@

<div slot="popup" class="tooltip-content">
<h4>{title}</h4>
<slot />
{@render children()}
</div>
</Tooltip>

Expand All @@ -31,6 +36,7 @@
.tooltip-content {
h4 {
margin-bottom: 0.75rem;
font: var(--f-heading-xs-medium);
letter-spacing: var(--f-heading-xs-spacing, normal);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@

{#if admin && position.hasInconsistentProfitability}
<PositionFlag status="warning" label="P" title="Profitability data inconsistent">
<p>
<Alert size="xs" status="info" title="Note">This info is only displayed to admin users.</Alert>
</p>
<Alert size="xs" status="info" title="Note">This info is only displayed to admin users.</Alert>
<p>
This position has inconsistent profitability data. The value from position stats does not match the result of
comparing all entry and exit trades.
Expand Down

0 comments on commit d1410ed

Please sign in to comment.