Created
April 11, 2021 16:55
-
-
Save omirobarcelo/e4605f1a1dc698b61988678ff22f6713 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script lang="ts"> | |
export let type: 'success' | 'error'; | |
export let message: string; | |
const CHECK = 'M0.5,8 L4,11.5 L11.5,3'; | |
const CROSS = 'M0.5,0.5 L11.5,11.5 M11.5,0.5 L0.5,11.5'; | |
</script> | |
<div class="alert {type}" role="alert"> | |
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12"> | |
<path stroke-width="2" stroke="white" fill="none" d={type === 'success' ? CHECK : CROSS} /> | |
</svg> | |
<p>{message}</p> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment