non working comments

This commit is contained in:
Mark Gregory
2026-06-17 08:39:47 +01:00
parent 15e62bfb40
commit 8060f7f086
3 changed files with 67 additions and 18 deletions
@@ -80,7 +80,7 @@
@endif
</section>
<form wire:submit="addComment" class="rounded-2xl border border-zinc-200 bg-white p-6 shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
<section class="rounded-2xl border border-zinc-200 bg-white p-6 shadow-sm dark:border-zinc-700 dark:bg-zinc-900" dusk="ticket-comment-form">
<h2 class="mb-4 text-base font-semibold text-zinc-900 dark:text-white">Add reply</h2>
@if ($cannedResponses->isNotEmpty())
<div class="mb-4 grid gap-3 md:grid-cols-[1fr_auto]">
@@ -96,7 +96,20 @@
</div>
@endif
<x-helpdesk::html-editor dusk="ticket-comment-editor" wire:model="commentBody" label="Comment" rows="5" placeholder="Write a professional response..." />
<div class="space-y-2">
<label for="ticket-comment-body" class="block text-sm font-medium text-zinc-700 dark:text-zinc-200">Comment</label>
<textarea
id="ticket-comment-body"
dusk="ticket-comment-body"
wire:model.live="commentBody"
rows="5"
placeholder="Write a professional response..."
class="block w-full rounded-xl border border-zinc-300 bg-white p-4 text-sm text-zinc-900 shadow-sm outline-none transition focus:border-emerald-500 focus:ring-2 focus:ring-emerald-500/30 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-100"
></textarea>
@error('commentBody')
<div class="text-sm text-red-600">{{ $message }}</div>
@enderror
</div>
@can('update', $ticket)
<div class="mt-4">
@@ -111,12 +124,20 @@
</div>
<div class="mt-5 flex justify-end">
<flux:button dusk="post-comment" type="submit" variant="primary" icon="chat-bubble-left-right" class="!bg-emerald-600 !text-white hover:!bg-emerald-700 focus:!ring-emerald-400/60" wire:loading.attr="disabled">
<span wire:loading.remove>Post reply</span>
<span wire:loading>Posting...</span>
</flux:button>
<button
dusk="post-comment"
type="button"
wire:click.prevent="addComment"
wire:target="addComment"
wire:loading.attr="disabled"
class="inline-flex items-center justify-center rounded-xl bg-emerald-600 px-4 py-2 text-sm font-semibold text-white shadow-sm transition hover:bg-emerald-700 focus:outline-none focus:ring-2 focus:ring-emerald-400/60 disabled:cursor-not-allowed disabled:opacity-70"
>
<i class="fa-solid fa-comments mr-2" aria-hidden="true"></i>
<span wire:loading.remove wire:target="addComment">Post reply</span>
<span wire:loading wire:target="addComment">Posting...</span>
</button>
</div>
</form>
</section>
</div>
<aside class="space-y-6">