<?php
use App\Models\Introductif;
use App\Models\ReportQuarter;
use Livewire\Component;
?>

<div>
    <div class="card_1">
        <div class="card-header my-0 pb-0">
            <div class="d-flex justify-content-between">
                <h5><u>Introduction</u></h5>
                <span>
                    <button wire:click="myInput" class="btn btn-inverse btn-outline-inverse btn-sm py-1 mt-0" title="Edit Info" data-toggle="modal" data-target="#myModal">
                        <i class="fas fa-pen m-0"></i>
                    </button>
                </span>
            </div>
        </div>
        <!-- <hr class="my-1 mx-3"> -->
        <div class="card-body table-border-style p-3 mt-2">
            {!! nl2br(e(ucfirst($data))) !!}
        </div>
    </div>
    <!-- @Modal -->
    <div wire:ignore.self class="modal fade" id="myModal" tabindex="-1" role="dialog">
        <div class="modal-dialog modal-lg modal-dialog-centered" role="document">
            <div class="modal-content">
                <div class="modal-header bg-dark py-2">
                    <h4 class="modal-title">Introduction</h4>
                    <strong style="font-size: 17px">
                        {{ $input ? 'Edit':'Add' }}
                        <i class="fas fa-pencil-alt my-0"></i>
                    </strong>
                </div>
                <form action="{{ route('trimestriel.store') }}" method="post">
                    @csrf
                    <div class="modal-body">
                        <label for='text'>Texte introductif<span class="text-danger">*</span> :</label>
                        <textarea name="text" rows="10" cols="5" class="form-control" id="text" placeholder="Entrez le texte introductif ici ..." style="resize: none;">{{ $input }}</textarea>
                    </div>
                    <div class="modal-footer">
                        <input type="hidden" name="school" value="{{ $school }}">
                        <input type="hidden" name="cutting" value="{{ $cutting }}">
                        <button class="btn btn-inverse btn-outline-inverse btn-sm py-1 mx-2" data-dismiss="modal">Fermer</button>
                        <button class="btn btn-inverse btn-outline-inverse btn-sm py-1 mx-2">Valider</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>