added admin control panel
This commit is contained in:
@@ -63,4 +63,32 @@ function formatSlug(slug: string) {
|
||||
<div class="prose prose-invert max-w-none" set:html={html} />
|
||||
)}
|
||||
</article>
|
||||
|
||||
<script>
|
||||
if (localStorage.getItem('admin_token')) {
|
||||
const editBtn = document.getElementById('edit-btn');
|
||||
if (editBtn) {
|
||||
editBtn.style.display = 'inline-flex';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</Layout>
|
||||
1.5-5.5Z"/><path d="m15 5 4 4"/></svg>
|
||||
Edit
|
||||
</a>
|
||||
</div>
|
||||
)}
|
||||
</header>
|
||||
|
||||
{error && (
|
||||
<div class="text-red text-center py-12">
|
||||
<h2 class="text-2xl font-bold mb-4">{error}</h2>
|
||||
<a href="/" class="text-blue underline">Return home</a>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{post && (
|
||||
<div class="prose prose-invert max-w-none" set:html={html} />
|
||||
)}
|
||||
</article>
|
||||
</Layout>
|
||||
|
||||
Reference in New Issue
Block a user