53 lines
1014 B
Svelte
53 lines
1014 B
Svelte
<script lang="ts">
|
|
|
|
export let icon = null
|
|
export let title;
|
|
export let validate = "Valider !"
|
|
export let onValidate = null
|
|
export let canValid = false
|
|
</script>
|
|
|
|
<div>
|
|
<h2>
|
|
<div class="icon">
|
|
<svelte:component this={icon}/></div>
|
|
{title}</h2>
|
|
<div class="content">
|
|
<slot/>
|
|
</div>
|
|
{#if !!onValidate}
|
|
<div class="btn-container">
|
|
<button on:click={onValidate} class="primary-btn" disabled={!canValid}>{validate}</button>
|
|
</div>
|
|
|
|
{/if}
|
|
</div>
|
|
|
|
<style lang="scss">
|
|
h2 {
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
.icon{
|
|
margin-right: 10px;
|
|
width: 25px;
|
|
height: 25px;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.content {
|
|
background: rgba($background, 0.7);
|
|
padding: 12px 8px;
|
|
margin: 10px;
|
|
border: 1px solid $border;
|
|
border-radius: 5px;
|
|
margin-left: 0;
|
|
}
|
|
|
|
.btn-container {
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
margin-top: 10px;
|
|
}
|
|
</style> |