refactor: improve code formatting and enhance readability in page.tsx

This commit is contained in:
Abhimanyu Saharan
2026-02-15 13:40:03 +05:30
parent aebd487270
commit a5ef3d3dcd

View File

@@ -111,10 +111,11 @@ function WebhookCard({
const trimmedDescription = draftDescription.trim(); const trimmedDescription = draftDescription.trim();
const isDescriptionChanged = const isDescriptionChanged =
trimmedDescription !== webhook.description.trim(); trimmedDescription !== webhook.description.trim();
const isAgentChanged = draftAgentValue !== (webhook.agent_id ?? LEAD_AGENT_VALUE); const isAgentChanged =
draftAgentValue !== (webhook.agent_id ?? LEAD_AGENT_VALUE);
const isChanged = isDescriptionChanged || isAgentChanged; const isChanged = isDescriptionChanged || isAgentChanged;
const mappedAgent = webhook.agent_id const mappedAgent = webhook.agent_id
? agents.find((agent) => agent.id === webhook.agent_id) ?? null ? (agents.find((agent) => agent.id === webhook.agent_id) ?? null)
: null; : null;
const handleSave = async () => { const handleSave = async () => {
@@ -243,7 +244,10 @@ function WebhookCard({
) : ( ) : (
<> <>
<div className="text-sm text-slate-700"> <div className="text-sm text-slate-700">
<Markdown content={webhook.description || ""} variant="description" /> <Markdown
content={webhook.description || ""}
variant="description"
/>
</div> </div>
<p className="text-xs text-slate-600"> <p className="text-xs text-slate-600">
Recipient: {mappedAgent?.name ?? "Lead agent"} Recipient: {mappedAgent?.name ?? "Lead agent"}