fix(rgi): proper table layout with td per column for alignment
Replaced single colSpan td with flex layout → proper td per column. Headers and data cells now align correctly. Expanded docs row uses colSpan only for the detail panel. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useCallback, useMemo } from "react";
|
||||
import React, { useState, useCallback, useMemo } from "react";
|
||||
import { Button } from "@/shared/components/ui/button";
|
||||
import { Input } from "@/shared/components/ui/input";
|
||||
import { Label } from "@/shared/components/ui/label";
|
||||
@@ -536,29 +536,25 @@ export default function RgiTestPage() {
|
||||
const solved = app.hasSolution === 1;
|
||||
|
||||
return (
|
||||
<tr key={pk} className="group">
|
||||
<td colSpan={columns.length + 2} className="p-0">
|
||||
{/* Row */}
|
||||
<div
|
||||
<React.Fragment key={pk}>
|
||||
<tr
|
||||
className={cn(
|
||||
"flex items-center cursor-pointer hover:bg-muted/30 transition-colors border-b",
|
||||
"border-b cursor-pointer hover:bg-muted/30 transition-colors",
|
||||
isExpanded && "bg-muted/20",
|
||||
)}
|
||||
onClick={() =>
|
||||
setExpandedPk(isExpanded ? null : pk)
|
||||
}
|
||||
>
|
||||
{/* Status icon */}
|
||||
<div className="px-2 py-2.5 shrink-0">
|
||||
<td className="px-2 py-2.5 w-8">
|
||||
{solved ? (
|
||||
<CheckCircle2 className="h-4 w-4 text-emerald-500" />
|
||||
) : (
|
||||
<Clock className="h-4 w-4 text-muted-foreground" />
|
||||
)}
|
||||
</div>
|
||||
{/* Columns */}
|
||||
</td>
|
||||
{columns.map((col) => (
|
||||
<div
|
||||
<td
|
||||
key={col.key}
|
||||
className={cn(
|
||||
"px-3 py-2.5 text-sm",
|
||||
@@ -587,29 +583,30 @@ export default function RgiTestPage() {
|
||||
) : (
|
||||
col.render(app)
|
||||
)}
|
||||
</div>
|
||||
</td>
|
||||
))}
|
||||
{/* Expand arrow */}
|
||||
<div className="px-2 py-2.5 shrink-0">
|
||||
<td className="px-2 py-2.5 w-8">
|
||||
{isExpanded ? (
|
||||
<ChevronUp className="h-4 w-4 text-muted-foreground" />
|
||||
) : (
|
||||
<ChevronDown className="h-4 w-4 text-muted-foreground" />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Expanded: issued documents */}
|
||||
</td>
|
||||
</tr>
|
||||
{isExpanded && (
|
||||
<div className="px-4 pb-3 bg-muted/10 border-b">
|
||||
<tr>
|
||||
<td
|
||||
colSpan={columns.length + 2}
|
||||
className="px-4 pb-3 bg-muted/10 border-b"
|
||||
>
|
||||
<IssuedDocsPanel
|
||||
applicationPk={pk}
|
||||
workspaceId={app.workspaceId}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</td>
|
||||
</tr>
|
||||
)}
|
||||
</React.Fragment>
|
||||
);
|
||||
})}
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user