mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 15:35:23 +02:00
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:
co-authored by
Claude Sonnet 4.6
parent
7eeccdaf8c
commit
ce9e91bad1
@@ -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 && (
|
||||
|
||||
Reference in New Issue
Block a user