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
@@ -566,6 +566,7 @@ export default function App() {
|
|||||||
<MissingDataView
|
<MissingDataView
|
||||||
data={appState.data}
|
data={appState.data}
|
||||||
headers={appState.headers}
|
headers={appState.headers}
|
||||||
|
onEdit={(index) => setEditingRowIndex(index)}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{activeModule === 'history' && (
|
{activeModule === 'history' && (
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import React, { useState, useMemo } from 'react';
|
import React, { useState, useMemo } from 'react';
|
||||||
import { ExcelRow, COLUMNS } from '../types';
|
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';
|
import { cn } from '../lib/utils';
|
||||||
|
|
||||||
interface MissingDataViewProps {
|
interface MissingDataViewProps {
|
||||||
data: ExcelRow[];
|
data: ExcelRow[];
|
||||||
headers: string[];
|
headers: string[];
|
||||||
|
onEdit: (index: number) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatDateValue(val: any): string {
|
function formatDateValue(val: any): string {
|
||||||
@@ -40,7 +41,7 @@ function isEmptyOrEpoch(val: any): boolean {
|
|||||||
|
|
||||||
type TabType = 'missingClass' | 'missingLaunch';
|
type TabType = 'missingClass' | 'missingLaunch';
|
||||||
|
|
||||||
export function MissingDataView({ data, headers }: MissingDataViewProps) {
|
export function MissingDataView({ data, headers, onEdit }: MissingDataViewProps) {
|
||||||
const [activeTab, setActiveTab] = useState<TabType>('missingClass');
|
const [activeTab, setActiveTab] = useState<TabType>('missingClass');
|
||||||
const [search, setSearch] = useState('');
|
const [search, setSearch] = useState('');
|
||||||
const [sortCol, setSortCol] = useState<number | null>(null);
|
const [sortCol, setSortCol] = useState<number | null>(null);
|
||||||
@@ -185,6 +186,7 @@ export function MissingDataView({ data, headers }: MissingDataViewProps) {
|
|||||||
</span>
|
</span>
|
||||||
</th>
|
</th>
|
||||||
))}
|
))}
|
||||||
|
<th className="px-3 py-3 font-medium text-right" style={{ width: 60 }}></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody className="divide-y divide-slate-700/30">
|
<tbody className="divide-y divide-slate-700/30">
|
||||||
@@ -228,6 +230,14 @@ export function MissingDataView({ data, headers }: MissingDataViewProps) {
|
|||||||
)}
|
)}
|
||||||
</td>
|
</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>
|
</tr>
|
||||||
))}
|
))}
|
||||||
{paginatedData.length === 0 && (
|
{paginatedData.length === 0 && (
|
||||||
|
|||||||
Reference in New Issue
Block a user