2020-10-06 17:46:23 +02:00
|
|
|
<script>
|
|
|
|
export let errors = []
|
|
|
|
|
|
|
|
$: hasErrors = errors.length > 0
|
|
|
|
</script>
|
|
|
|
|
|
|
|
{#if hasErrors}
|
|
|
|
<div class="container">
|
|
|
|
{#each errors as error}
|
|
|
|
<div class="error">{error.dataPath} {error.message}</div>
|
|
|
|
{/each}
|
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.container {
|
|
|
|
border-radius: var(--border-radius-m);
|
|
|
|
margin: 0;
|
|
|
|
padding: var(--spacing-m);
|
|
|
|
background-color: var(--red-light);
|
|
|
|
}
|
|
|
|
|
|
|
|
.error {
|
|
|
|
font-size: var(--font-size-xs);
|
2021-05-25 11:11:41 +02:00
|
|
|
font-weight: 600;
|
2020-10-06 17:46:23 +02:00
|
|
|
color: var(--red-dark);
|
|
|
|
}
|
|
|
|
.error:first-letter {
|
|
|
|
text-transform: uppercase;
|
|
|
|
}
|
|
|
|
</style>
|