feat(time-entry-quick-edit): Inline-Edit für TimeEntry-Description (Klick auf Description [tsc:fail]
This commit is contained in:
parent
738acb36a6
commit
9a6cb779ee
@ -1,10 +1,11 @@
|
|||||||
{
|
{
|
||||||
"completed_features": [],
|
"completed_features": [],
|
||||||
"current_feature": "smart-filter-suggestions",
|
"current_feature": "time-entry-quick-edit",
|
||||||
"started_at": "2026-05-23T07:18:43.778897",
|
"started_at": "2026-05-23T07:18:43.778897",
|
||||||
"attempted_features": [
|
"attempted_features": [
|
||||||
"calendar-month-view",
|
"calendar-month-view",
|
||||||
"batch-rename-projects",
|
"batch-rename-projects",
|
||||||
"customer-merge"
|
"customer-merge",
|
||||||
|
"smart-filter-suggestions"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -2090,3 +2090,20 @@ src/index.ts(27,25): error TS2769: No overload matches this call.
|
|||||||
Overload 2 of 3, '(plugin: FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error.
|
Overload 2 of 3, '(plugin: FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error.
|
||||||
Argument of type 'Promise<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
|
Argument of type 'Promise<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
|
||||||
Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, FastifyBaseLogger, FastifyTy
|
Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, FastifyBaseLogger, FastifyTy
|
||||||
|
- `07:26:25` **INFO** Committed feature smart-filter-suggestions
|
||||||
|
- `07:26:25` **INFO** Pushed: rc=0
|
||||||
|
|
||||||
|
## Phase-3 Feature: time-entry-quick-edit (2026-05-23 07:26:25)
|
||||||
|
|
||||||
|
- `07:26:25` **INFO** Description: Inline-Edit für TimeEntry-Description (Klick auf Description = Input)
|
||||||
|
- `07:26:25` **INFO** Generating apps/web/src/pages/TimeEntries.tsx (ERWEITERT — in der Liste: Description-Zelle wird beim Klick zu Input (…)
|
||||||
|
- `07:28:07` **INFO** wrote 13052 chars in 101.8s (attempt 1)
|
||||||
|
- `07:28:07` **INFO** Running tsc --noEmit on api…
|
||||||
|
- `07:28:08` **WARN** tsc errors:
|
||||||
|
src/index.ts(27,25): error TS2769: No overload matches this call.
|
||||||
|
Overload 1 of 3, '(plugin: FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error.
|
||||||
|
Argument of type 'Promise<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
|
||||||
|
Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, FastifyBaseLogger, FastifyTypeProvider>, opts: { ...; }, done: (err?: Error | undefined) => void): void'.
|
||||||
|
Overload 2 of 3, '(plugin: FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error.
|
||||||
|
Argument of type 'Promise<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
|
||||||
|
Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, FastifyBaseLogger, FastifyTy
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { EmptyState } from "../components/EmptyState"
|
|||||||
import { LoadingSpinner } from "../components/LoadingSpinner"
|
import { LoadingSpinner } from "../components/LoadingSpinner"
|
||||||
import { SuggestionInput } from "../components/SuggestionInput"
|
import { SuggestionInput } from "../components/SuggestionInput"
|
||||||
import { SmartFilters } from "../components/SmartFilters"
|
import { SmartFilters } from "../components/SmartFilters"
|
||||||
import type { TimeEntryInsert, SavedView } from "@emberclone/shared"
|
import type { TimeEntryInsert, SavedView, TimeEntry } from "@emberclone/shared"
|
||||||
|
|
||||||
function renderSimpleMarkdown(text: string | null) {
|
function renderSimpleMarkdown(text: string | null) {
|
||||||
if (!text) return null
|
if (!text) return null
|
||||||
@ -40,6 +40,8 @@ export default function TimeEntries() {
|
|||||||
|
|
||||||
const [selectedIds, setSelectedIds] = useState<string[]>([])
|
const [selectedIds, setSelectedIds] = useState<string[]>([])
|
||||||
const [expandedRows, setExpandedRows] = useState<Record<string, boolean>>({})
|
const [expandedRows, setExpandedRows] = useState<Record<string, boolean>>({})
|
||||||
|
const [editingId, setEditingId] = useState<string | null>(null)
|
||||||
|
const [editValue, setEditValue] = useState("")
|
||||||
|
|
||||||
const { data: entries, isLoading, isError } = useQuery({
|
const { data: entries, isLoading, isError } = useQuery({
|
||||||
queryKey: ["time-entries", filters.from, filters.to],
|
queryKey: ["time-entries", filters.from, filters.to],
|
||||||
@ -67,6 +69,14 @@ export default function TimeEntries() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const updateMutation = useMutation({
|
||||||
|
mutationFn: ({ id, data }: { id: string, data: Partial<TimeEntryInsert> }) => api.updateTimeEntry(id, data),
|
||||||
|
onSuccess: () => {
|
||||||
|
queryClient.invalidateQueries({ queryKey: ["time-entries"] })
|
||||||
|
setEditingId(null)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const deleteMutation = useMutation({
|
const deleteMutation = useMutation({
|
||||||
mutationFn: (id: string) => api.deleteTimeEntry(id),
|
mutationFn: (id: string) => api.deleteTimeEntry(id),
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
@ -121,20 +131,40 @@ export default function TimeEntries() {
|
|||||||
startTime: new Date(formData.startTime) as any,
|
startTime: new Date(formData.startTime) as any,
|
||||||
endTime: new Date(formData.endTime) as any,
|
endTime: new Date(formData.endTime) as any,
|
||||||
projectId: formData.projectId || undefined,
|
projectId: formData.projectId || undefined,
|
||||||
notes: formData.notes || undefined
|
notes: formData.notes
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleStartEditing = (entry: TimeEntry) => {
|
||||||
|
setEditingId(entry.id)
|
||||||
|
setEditValue(entry.description || "")
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleEditBlur = () => {
|
||||||
|
if (editingId) {
|
||||||
|
updateMutation.mutate({ id: editingId, data: { description: editValue } })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleEditKeyDown = (e: React.KeyboardEvent) => {
|
||||||
|
if (e.key === 'Enter') {
|
||||||
|
handleEditBlur()
|
||||||
|
} else if (e.key === 'Escape') {
|
||||||
|
setEditingId(null)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isLoading) return <div className="p-8 flex justify-center"><LoadingSpinner /></div>
|
||||||
if (isError) return <div className="p-8 text-red-500">Error loading time entries.</div>
|
if (isError) return <div className="p-8 text-red-500">Error loading time entries.</div>
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="p-8 max-w-6xl mx-auto">
|
<div className="p-6 max-w-7xl mx-auto space-y-6">
|
||||||
<div className="flex justify-between items-center mb-8">
|
<div className="flex justify-between items-center">
|
||||||
<h1 className="text-3xl font-bold">Time Entries</h1>
|
<h1 className="text-2xl font-bold">Time Entries</h1>
|
||||||
<div className="flex gap-2">
|
<div className="flex gap-2">
|
||||||
<button
|
<button
|
||||||
onClick={() => fileInputRef.current?.click()}
|
onClick={() => fileInputRef.current?.click()}
|
||||||
className="px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded text-sm font-medium"
|
className="px-3 py-2 text-sm bg-gray-100 hover:bg-gray-200 rounded"
|
||||||
>
|
>
|
||||||
Import CSV
|
Import CSV
|
||||||
</button>
|
</button>
|
||||||
@ -148,92 +178,57 @@ export default function TimeEntries() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form onSubmit={handleSubmit} className="grid grid-cols-1 md:grid-cols-5 gap-4 mb-8 p-4 bg-gray-50 rounded-lg border">
|
<form onSubmit={handleSubmit} className="grid grid-cols-1 md:grid-cols-5 gap-3 p-4 bg-gray-50 rounded-lg border">
|
||||||
<div className="md:col-span-2">
|
|
||||||
<SuggestionInput
|
<SuggestionInput
|
||||||
label="Description"
|
|
||||||
value={formData.description}
|
value={formData.description}
|
||||||
onChange={v => setFormData(prev => ({ ...prev, description: v }))}
|
onChange={v => setFormData({...formData, description: v})}
|
||||||
suggestions={descriptionSuggestions}
|
suggestions={descriptionSuggestions}
|
||||||
placeholder="What did you work on?"
|
placeholder="Description"
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label className="block text-xs font-medium text-gray-500 mb-1">Start Time</label>
|
|
||||||
<input
|
<input
|
||||||
type="datetime-local"
|
type="datetime-local"
|
||||||
className="w-full p-2 border rounded text-sm"
|
className="p-2 border rounded text-sm"
|
||||||
value={formData.startTime}
|
value={formData.startTime}
|
||||||
onChange={e => setFormData(prev => ({ ...prev, startTime: e.target.value }))}
|
onChange={e => setFormData({...formData, startTime: e.target.value})}
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label className="block text-xs font-medium text-gray-500 mb-1">End Time</label>
|
|
||||||
<input
|
<input
|
||||||
type="datetime-local"
|
type="datetime-local"
|
||||||
className="w-full p-2 border rounded text-sm"
|
className="p-2 border rounded text-sm"
|
||||||
value={formData.endTime}
|
value={formData.endTime}
|
||||||
onChange={e => setFormData(prev => ({ ...prev, endTime: e.target.value }))}
|
onChange={e => setFormData({...formData, endTime: e.target.value})}
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
</div>
|
<input
|
||||||
<div className="flex items-end">
|
type="text"
|
||||||
<button
|
className="p-2 border rounded text-sm"
|
||||||
type="submit"
|
placeholder="Project ID"
|
||||||
disabled={createMutation.isPending}
|
value={formData.projectId}
|
||||||
className="w-full py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50 font-medium"
|
onChange={e => setFormData({...formData, projectId: e.target.value})}
|
||||||
>
|
/>
|
||||||
{createMutation.isPending ? "Saving..." : "Add Entry"}
|
<button type="submit" className="bg-blue-600 text-white px-4 py-2 rounded text-sm font-medium hover:bg-blue-700">
|
||||||
|
Add Entry
|
||||||
</button>
|
</button>
|
||||||
</div>
|
|
||||||
<div className="md:col-span-5">
|
<div className="md:col-span-5">
|
||||||
<label className="block text-xs font-medium text-gray-500 mb-1">Notes (Optional)</label>
|
|
||||||
<textarea
|
<textarea
|
||||||
className="w-full p-2 border rounded text-sm"
|
className="w-full p-2 border rounded text-sm"
|
||||||
rows={2}
|
placeholder="Notes (optional)"
|
||||||
value={formData.notes}
|
value={formData.notes}
|
||||||
onChange={e => setFormData(prev => ({ ...prev, notes: e.target.value }))}
|
onChange={e => setFormData({...formData, notes: e.target.value})}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div className="mb-6 space-y-4">
|
<SmartFilters
|
||||||
<SmartFilters onApply={setFilters} />
|
filters={filters}
|
||||||
|
setFilters={setFilters}
|
||||||
|
savedViews={savedViews || []}
|
||||||
|
onSaveView={(v) => saveViewMutation.mutate(v)}
|
||||||
|
onDeleteView={(id) => deleteViewMutation.mutate(id)}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className="flex flex-wrap gap-4 items-center bg-white p-4 border rounded-lg shadow-sm">
|
{filteredEntries.length === 0 ? (
|
||||||
<div className="flex-1 min-w-[200px]">
|
<EmptyState message="No time entries found." />
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
placeholder="Search descriptions..."
|
|
||||||
className="w-full p-2 border rounded text-sm"
|
|
||||||
value={filters.search}
|
|
||||||
onChange={e => setFilters(prev => ({ ...prev, search: e.target.value }))}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="flex gap-2 items-center">
|
|
||||||
<span className="text-xs text-gray-500">From:</span>
|
|
||||||
<input
|
|
||||||
type="date"
|
|
||||||
className="p-2 border rounded text-sm"
|
|
||||||
value={filters.from}
|
|
||||||
onChange={e => setFilters(prev => ({ ...prev, from: e.target.value }))}
|
|
||||||
/>
|
|
||||||
<span className="text-xs text-gray-500">To:</span>
|
|
||||||
<input
|
|
||||||
type="date"
|
|
||||||
className="p-2 border rounded text-sm"
|
|
||||||
value={filters.to}
|
|
||||||
onChange={e => setFilters(prev => ({ ...prev, to: e.target.value }))}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{isLoading ? (
|
|
||||||
<div className="flex justify-center py-12"><LoadingSpinner /></div>
|
|
||||||
) : filteredEntries.length === 0 ? (
|
|
||||||
<EmptyState message="No time entries found matching your filters." />
|
|
||||||
) : (
|
) : (
|
||||||
<div className="overflow-x-auto border rounded-lg">
|
<div className="overflow-x-auto border rounded-lg">
|
||||||
<table className="w-full text-left text-sm">
|
<table className="w-full text-left text-sm">
|
||||||
@ -242,83 +237,107 @@ export default function TimeEntries() {
|
|||||||
<th className="p-3 w-10">
|
<th className="p-3 w-10">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
className="rounded"
|
|
||||||
checked={selectedIds.length === filteredEntries.length}
|
checked={selectedIds.length === filteredEntries.length}
|
||||||
onChange={e => {
|
onChange={e => setSelectedIds(e.target.checked ? filteredEntries.map(en => en.id) : [])}
|
||||||
if (e.target.checked) setSelectedIds(filteredEntries.map(en => en.id))
|
|
||||||
else setSelectedIds([])
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</th>
|
</th>
|
||||||
<th className="p-3 font-semibold">Description</th>
|
<th className="p-3 font-semibold">Description</th>
|
||||||
<th className="p-3 font-semibold">Start</th>
|
<th className="p-3 font-semibold">Start</th>
|
||||||
<th className="p-3 font-semibold">End</th>
|
<th className="p-3 font-semibold">End</th>
|
||||||
<th className="p-3 font-semibold">Duration</th>
|
<th className="p-3 font-semibold">Duration</th>
|
||||||
|
<th className="p-3 font-semibold">Project</th>
|
||||||
<th className="p-3 font-semibold text-right">Actions</th>
|
<th className="p-3 font-semibold text-right">Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{filteredEntries.map(entry => {
|
{filteredEntries.map(entry => {
|
||||||
const durationMs = new Date(entry.endTime).getTime() - new Date(entry.startTime).getTime()
|
const durationMs = new Date(entry.endTime).getTime() - new Date(entry.startTime).getTime()
|
||||||
const durationHrs = (durationMs / (1000 * 60 * 60)).toFixed(2)
|
const durationHours = (durationMs / (1000 * 60 * 60)).toFixed(2)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<tr key={entry.id} className="border-b hover:bg-gray-50 group">
|
<React.Fragment key={entry.id}>
|
||||||
|
<tr className={`border-b hover:bg-gray-50 ${selectedIds.includes(entry.id) ? 'bg-blue-50' : ''}`}>
|
||||||
<td className="p-3">
|
<td className="p-3">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
className="rounded"
|
|
||||||
checked={selectedIds.includes(entry.id)}
|
checked={selectedIds.includes(entry.id)}
|
||||||
onChange={e => {
|
onChange={e => setSelectedIds(prev => e.target.checked ? [...prev, entry.id] : prev.filter(id => id !== entry.id))}
|
||||||
if (e.target.checked) setSelectedIds(prev => [...prev, entry.id])
|
|
||||||
else setSelectedIds(prev => prev.filter(id => id !== entry.id))
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
<td className="p-3">
|
<td
|
||||||
<div
|
className="p-3 cursor-pointer hover:bg-blue-100 transition-colors"
|
||||||
className="cursor-pointer"
|
onClick={() => handleStartEditing(entry)}
|
||||||
onClick={() => setExpandedRows(prev => ({ ...prev, [entry.id]: !prev[entry.id] }))}
|
|
||||||
>
|
>
|
||||||
<div className="font-medium">{entry.description}</div>
|
{editingId === entry.id ? (
|
||||||
{expandedRows[entry.id] && (
|
<input
|
||||||
<div className="mt-2 text-xs text-gray-600 bg-gray-100 p-2 rounded max-w-md">
|
autoFocus
|
||||||
{renderSimpleMarkdown(entry.notes)}
|
className="w-full p-1 border rounded"
|
||||||
</div>
|
value={editValue}
|
||||||
|
onChange={e => setEditValue(e.target.value)}
|
||||||
|
onBlur={handleEditBlur}
|
||||||
|
onKeyDown={handleEditKeyDown}
|
||||||
|
onClick={(e) => e.stopPropagation()}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<span className="block truncate max-w-md">{entry.description}</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
|
||||||
</td>
|
</td>
|
||||||
<td className="p-3 text-gray-500">
|
<td className="p-3 text-gray-600">{new Date(entry.startTime).toLocaleString()}</td>
|
||||||
{new Date(entry.startTime).toLocaleString()}
|
<td className="p-3 text-gray-600">{new Date(entry.endTime).toLocaleString()}</td>
|
||||||
</td>
|
<td className="p-3 font-mono">{durationHours}h</td>
|
||||||
<td className="p-3 text-gray-500">
|
<td className="p-3 text-gray-500">{entry.projectId}</td>
|
||||||
{new Date(entry.endTime).toLocaleString()}
|
<td className="p-3 text-right space-x-2">
|
||||||
</td>
|
|
||||||
<td className="p-3 font-mono">{durationHrs}h</td>
|
|
||||||
<td className="p-3 text-right">
|
|
||||||
<button
|
<button
|
||||||
onClick={() => { if(confirm("Delete entry?")) deleteMutation.mutate(entry.id) }}
|
onClick={() => setExpandedRows(prev => ({...prev, [entry.id]: !prev[entry.id]}))}
|
||||||
className="text-red-500 opacity-0 group-hover:opacity-100 hover:text-red-700 transition-opacity"
|
className="text-blue-600 hover:underline"
|
||||||
|
>
|
||||||
|
{expandedRows[entry.id] ? 'Hide' : 'Details'}
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
onClick={() => deleteMutation.mutate(entry.id)}
|
||||||
|
className="text-red-600 hover:underline"
|
||||||
>
|
>
|
||||||
Delete
|
Delete
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
)
|
{expandedRows[entry.id] && (
|
||||||
})}
|
<tr className="bg-gray-50">
|
||||||
|
<td colSpan={7} className="p-4 border-b">
|
||||||
|
<div className="text-xs text-gray-500 mb-2 uppercase font-bold">Notes</div>
|
||||||
|
<div className="text-sm prose prose-sm max-w-none">
|
||||||
|
{renderSimpleMarkdown(entry.notes)}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
)}
|
||||||
|
</React.Fragment>
|
||||||
|
)}
|
||||||
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
{selectedIds.length > 0 && (
|
{selectedIds.length > 0 && (
|
||||||
<div className="p-3 bg-blue-50 border-t flex justify-between items-center">
|
<div className="fixed bottom-6 left-1/2 -translate-x-1/2 bg-white shadow-xl border rounded-full px-6 py-3 flex items-center gap-4 animate-in fade-in slide-in-from-bottom-4">
|
||||||
<span className="text-sm font-medium">{selectedIds.length} entries selected</span>
|
<span className="text-sm font-medium">{selectedIds.length} entries selected</span>
|
||||||
<button
|
<button
|
||||||
onClick={() => { if(confirm(`Delete ${selectedIds.length} entries?`)) bulkDeleteMutation.mutate(selectedIds) }}
|
onClick={() => {
|
||||||
className="px-3 py-1 bg-red-600 text-white rounded text-xs hover:bg-red-700"
|
if (confirm(`Delete ${selectedIds.length} entries?`)) {
|
||||||
|
bulkDeleteMutation.mutate(selectedIds)
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
className="text-sm text-red-600 font-bold hover:text-red-800"
|
||||||
>
|
>
|
||||||
Delete Selected
|
Delete Selected
|
||||||
</button>
|
</button>
|
||||||
</div>
|
<button
|
||||||
)}
|
onClick={() => setSelectedIds([])}
|
||||||
|
className="text-sm text-gray-500 hover:text-gray-700"
|
||||||
|
>
|
||||||
|
Cancel
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user