@extends('layouts.admin')

@section('content')

<h2 style="margin-bottom:20px;">Edit Pengumuman</h2>

<div class="card" style="position:relative;">

<form method="POST" action="/admin/announcement/{{ $announcement->id }}/update">
@csrf

<label>Judul</label>
<input type="text" name="title"
value="{{ $announcement->title }}"
required
style="width:100%; padding:12px; margin-top:8px;">

<br><br>

<label>Isi Pegumuman</label>
<textarea name="message" rows="6" required
style="width:100%; padding:12px; margin-top:8px;">{{ $announcement->message }}</textarea>

<br><br>

<div style="display:flex; gap:10px;">

<button
type="submit"
style="
background:#16a34a;
color:white;
padding:10px 18px;
border:none;
border-radius:8px;
text-decoration:none;
font-weight:600;
cursor:pointer;
display:inline-block;
font-size:14px;
">
Update Pengumuman
</button>

<a href="/admin/announcement/{{ $announcement->id }}/delete"
onclick="return confirm('Hapus Pengumuman ini?')"
style="
background:#dc2626;
color:white;
padding:10px 18px;
border-radius:8px;
text-decoration:none;
font-weight:600;
display:inline-block;
">
Hapus
</a>

</div>

</form>

</div>

@endsection