MapComplete/src/UI/Studio/ErrorIndicatorForRegion.svelte

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
583 B
Svelte
Raw Normal View History

<script lang="ts">
2023-11-09 16:30:26 +01:00
import EditLayerState from "./EditLayerState"
import { ExclamationIcon } from "@rgossiaux/svelte-heroicons/solid"
2023-11-09 16:30:26 +01:00
export let firstPaths: Set<string>
export let state: EditLayerState
let messagesCount = state.messages.map(
(msgs) =>
msgs.filter((msg) => {
const pth = msg.context.path
return firstPaths.has(pth[0]) || (pth.length > 1 && firstPaths.has(pth[1]))
}).length
)
</script>
{#if $messagesCount > 0}
<span class="alert flex w-min">
2023-11-09 16:30:26 +01:00
<ExclamationIcon class="h-6 w-6" />
{$messagesCount}
</span>
{/if}