fix: resolve TS errors in Settings and Notifications pages
- Remove unused Pencil import and editId/handleUpdate from SettingsPage - Wrap lucide icons with span for title attribute in NotificationsPage Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -143,9 +143,9 @@ export function NotificationsPage() {
|
|||||||
{n.type}
|
{n.type}
|
||||||
</span>
|
</span>
|
||||||
{n.emailSent ? (
|
{n.emailSent ? (
|
||||||
<Mail className="size-3.5 text-green-500" title="Email sent" />
|
<span title="Email sent"><Mail className="size-3.5 text-green-500" /></span>
|
||||||
) : (
|
) : (
|
||||||
<MailX className="size-3.5 text-muted-foreground" title="Email not sent" />
|
<span title="Email not sent"><MailX className="size-3.5 text-muted-foreground" /></span>
|
||||||
)}
|
)}
|
||||||
{!n.read && (
|
{!n.read && (
|
||||||
<span className="size-2 rounded-full bg-blue-500" />
|
<span className="size-2 rounded-full bg-blue-500" />
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useEffect, useState, useCallback } from "react"
|
import { useEffect, useState, useCallback } from "react"
|
||||||
import { UserPlus, Trash2, Shield, Code, Bell, BellOff, Pencil, Check, X } from "lucide-react"
|
import { UserPlus, Trash2, Shield, Code, Bell, BellOff, Check, X } from "lucide-react"
|
||||||
|
|
||||||
interface MonitorUser {
|
interface MonitorUser {
|
||||||
id: string
|
id: string
|
||||||
@@ -33,7 +33,6 @@ export function SettingsPage() {
|
|||||||
const [users, setUsers] = useState<MonitorUser[]>([])
|
const [users, setUsers] = useState<MonitorUser[]>([])
|
||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true)
|
||||||
const [showForm, setShowForm] = useState(false)
|
const [showForm, setShowForm] = useState(false)
|
||||||
const [editId, setEditId] = useState<string | null>(null)
|
|
||||||
const [form, setForm] = useState({ email: "", name: "", role: "developer" as MonitorUser["role"], notifyOnError: true })
|
const [form, setForm] = useState({ email: "", name: "", role: "developer" as MonitorUser["role"], notifyOnError: true })
|
||||||
const [error, setError] = useState("")
|
const [error, setError] = useState("")
|
||||||
|
|
||||||
@@ -62,20 +61,6 @@ export function SettingsPage() {
|
|||||||
} catch (e) { setError((e as Error).message) }
|
} catch (e) { setError((e as Error).message) }
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleUpdate = async (id: string) => {
|
|
||||||
const user = users.find(u => u.id === id)
|
|
||||||
if (!user) return
|
|
||||||
try {
|
|
||||||
setError("")
|
|
||||||
await apiFetch(`/api/users/${id}`, {
|
|
||||||
method: "PUT",
|
|
||||||
body: JSON.stringify({ name: user.name, role: user.role, notifyOnError: user.notifyOnError }),
|
|
||||||
})
|
|
||||||
setEditId(null)
|
|
||||||
load()
|
|
||||||
} catch (e) { setError((e as Error).message) }
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleDelete = async (id: string, name: string) => {
|
const handleDelete = async (id: string, name: string) => {
|
||||||
if (!confirm(`Remove ${name} from the user list?`)) return
|
if (!confirm(`Remove ${name} from the user list?`)) return
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user