feat: add Edit button to each row in Missing Data view

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Christian Vidal Wolf
2026-04-12 15:19:20 +02:00
co-authored by Claude Sonnet 4.6
parent 7eeccdaf8c
commit ce9e91bad1
2 changed files with 13 additions and 2 deletions
+1
View File
@@ -566,6 +566,7 @@ export default function App() {
<MissingDataView
data={appState.data}
headers={appState.headers}
onEdit={(index) => setEditingRowIndex(index)}
/>
)}
{activeModule === 'history' && (
+12 -2
View File
@@ -1,11 +1,12 @@
import React, { useState, useMemo } from 'react';
import { ExcelRow, COLUMNS } from '../types';
import { Search, ChevronDown, ChevronUp, X } from 'lucide-react';
import { Search, ChevronDown, ChevronUp, X, Edit2 } from 'lucide-react';
import { cn } from '../lib/utils';
interface MissingDataViewProps {
data: ExcelRow[];
headers: string[];
onEdit: (index: number) => void;
}
function formatDateValue(val: any): string {
@@ -40,7 +41,7 @@ function isEmptyOrEpoch(val: any): boolean {
type TabType = 'missingClass' | 'missingLaunch';
export function MissingDataView({ data, headers }: MissingDataViewProps) {
export function MissingDataView({ data, headers, onEdit }: MissingDataViewProps) {
const [activeTab, setActiveTab] = useState<TabType>('missingClass');
const [search, setSearch] = useState('');
const [sortCol, setSortCol] = useState<number | null>(null);
@@ -185,6 +186,7 @@ export function MissingDataView({ data, headers }: MissingDataViewProps) {
</span>
</th>
))}
<th className="px-3 py-3 font-medium text-right" style={{ width: 60 }}></th>
</tr>
</thead>
<tbody className="divide-y divide-slate-700/30">
@@ -228,6 +230,14 @@ export function MissingDataView({ data, headers }: MissingDataViewProps) {
)}
</td>
)}
<td className="px-3 py-2 text-right" style={{ width: 60 }}>
<button
onClick={() => onEdit(index)}
className="p-1.5 text-slate-500 hover:text-indigo-400 hover:bg-indigo-400/10 rounded transition-colors"
>
<Edit2 className="w-4 h-4" />
</button>
</td>
</tr>
))}
{paginatedData.length === 0 && (