Initial import: property management SaaS + security hardening + admin dashboard
Property Management Network — Next.js 16 (App Router), Better Auth, Drizzle ORM over PostgreSQL, Stripe, OpenAI, Resend. Includes: - Security hardening: access-control/IDOR fixes, TLS-by-default DB layer, constant-time cron auth, strict security headers, atomic AI quota gating, HTML/email output encoding, demo-backdoor disabled in production. - Superadmin dashboard at /admin (overview/MRR, server-paginated users with ban/impersonate/plan/delete, billing, platform activity + admin audit log, AI usage, system health) via the Better Auth admin plugin. - Seed/migration utility scripts under scripts/. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
"use client"
|
||||
|
||||
import { useState } from "react"
|
||||
import { Bell, Loader2 } from "lucide-react"
|
||||
import { toast } from "sonner"
|
||||
|
||||
export function SendReminderButton({ tenantId, paymentId }: { tenantId: string; paymentId: string }) {
|
||||
const [loading, setLoading] = useState(false)
|
||||
|
||||
async function send() {
|
||||
setLoading(true)
|
||||
const res = await fetch("/api/notifications", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ type: "rent_reminder", tenant_id: tenantId, payment_id: paymentId }),
|
||||
})
|
||||
setLoading(false)
|
||||
if (res.ok) toast.success("Reminder sent")
|
||||
else toast.error("Failed to send reminder")
|
||||
}
|
||||
|
||||
return (
|
||||
<button
|
||||
onClick={send}
|
||||
disabled={loading}
|
||||
title="Send rent reminder"
|
||||
className="flex h-7 items-center gap-1.5 rounded-md border border-white/10 px-2.5 text-xs text-white/50 transition hover:border-amber-500/30 hover:text-amber-400 disabled:opacity-40"
|
||||
>
|
||||
{loading ? <Loader2 className="h-3 w-3 animate-spin" /> : <Bell className="h-3 w-3" />}
|
||||
Remind
|
||||
</button>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user