<script lang="ts">
    import { Derived } from '../calcul'
    import { getContext } from 'svelte'

    const _simulation: Derived = getContext('simulation')

    const inflationElec = _simulation.p.inflation_elec
    const enedis = _simulation.p.enedis
    const productible = _simulation.p.productible
    const ratio = _simulation.p.ratio
    const degradation = _simulation.p.degradation
    const tauxDSRA = _simulation.p.taux_dsra
    const inflation = _simulation.p.inflation
    const tarif_cre = _simulation.p.tarif_cre
</script>

<div class="p-10 flex flex-col">
    <h1 class="my-8 text-4xl font-bold">
        D'avantage de <span class="text-primary">réglages</span>
    </h1>
    <div class="mt-5 flex flex-col gap-5">
        <div class=" flex flex-col">
            <label class="label" for="enedis"
                >Coût de raccordement Enedis</label>
            <input
                class="input input-sm"
                type="number"
                id="enedis"
                min="0"
                bind:value={$enedis} />
        </div>

        <div class=" flex flex-col">
            <label class="label" for="productible"
                >Productible annuel (kWh/kWc)</label>
            <input
                class="input input-sm"
                type="number"
                id="productible"
                min="0"
                bind:value={$productible} />
        </div>

        <div class=" flex flex-col">
            <label class="label" for="ratio">Ratio installation (€/W)</label>
            <input
                class="input input-sm"
                type="number"
                id="ratio"
                min="0"
                bind:value={$ratio} />
        </div>

        <div class=" flex flex-col">
            <label class="label" for="degradation"
                >Taux de dégradation PV(%)</label>
            <input
                class="input input-sm"
                type="number"
                id="degradation"
                min="0"
                bind:value={$degradation} />
        </div>

        <div class=" flex flex-col">
            <label class="label" for="dsra">Taux d'intérêt DSRA (%)</label>
            <input
                class="input input-sm"
                type="number"
                id="dsra"
                min="0"
                step="any"
                bind:value={$tauxDSRA} />
        </div>

        <div class=" flex flex-col">
            <label class="label" for="inflation">Inflation tarif local</label>
            <input
                class="input input-sm"
                type="number"
                id="inflation"
                min="0"
                bind:value={$inflation} />
        </div>
        <div class=" flex flex-col">
            <label class="label" for="inflationElec"
                >Inflation nationale de l'électricité (%)</label>
            <input
                class="input input-sm"
                type="number"
                bind:value={$inflationElec}
                min="0"
                id="inflationElec" />
        </div>
        <div class=" flex flex-col">
            <label class="label" for="tarif_cre"
                >Prix d'achat de surplus &lt;9kWc (€/kWh)</label>
            <input
                class="input input-sm"
                type="number"
                bind:value={$tarif_cre.prix[0]}
                min="0"
                id="tarif_cre" />
        </div>
        <div class=" flex flex-col">
            <label class="label" for="tarif_cre2"
                >Prix d'achat de surplus &lt;100 (€/kWh)</label>
            <input
                class="input input-sm"
                type="number"
                bind:value={$tarif_cre.prix[1]}
                min="0"
                id="tarif_cre2" />
        </div>
        <div class=" flex flex-col">
            <label class="label" for="tarif_cre3"
                >Prix d'achat de surplus &ge;100 (€/kWh)</label>
            <input
                class="input input-sm"
                type="number"
                bind:value={$tarif_cre.prix[2]}
                min="0"
                id="tarif_cre3" />
        </div>
    </div>
</div>
