Spaces:
Sleeping
Sleeping
Shrink data tables to fit content with better padding
Browse files- Change table containers from full-width to w-fit (shrink-to-fit)
- Remove w-full from tables so they size to content
- Increase cell padding from px-2 to px-3 for readability
- Add p-2 padding around table content
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
frontend/src/components/MCPDataPanel.tsx
CHANGED
|
@@ -359,33 +359,33 @@ export function MCPDataPanel({ metrics, rawData, companyName, ticker, exchange,
|
|
| 359 |
|
| 360 |
{/* Quantitative Data Table */}
|
| 361 |
{quantitativeRows.length > 0 && (
|
| 362 |
-
<div className="bg-card rounded-lg border border-border overflow-hidden">
|
| 363 |
-
<div className="px-
|
| 364 |
<h3 className="text-sm font-medium text-foreground">Quantitative Data</h3>
|
| 365 |
</div>
|
| 366 |
-
<div className="overflow-x-auto">
|
| 367 |
-
<table className="
|
| 368 |
<thead className="bg-muted/30">
|
| 369 |
<tr>
|
| 370 |
-
<th className="px-
|
| 371 |
-
<th className="px-
|
| 372 |
-
<th className="px-
|
| 373 |
-
<th className="px-
|
| 374 |
-
<th className="px-
|
| 375 |
-
<th className="px-
|
| 376 |
-
<th className="px-
|
| 377 |
</tr>
|
| 378 |
</thead>
|
| 379 |
<tbody className="divide-y divide-border">
|
| 380 |
{quantitativeRows.map((row, idx) => (
|
| 381 |
<tr key={idx} className="hover:bg-muted/20">
|
| 382 |
-
<td className="px-
|
| 383 |
-
<td className="px-
|
| 384 |
-
<td className="px-
|
| 385 |
-
<td className="px-
|
| 386 |
-
<td className="px-
|
| 387 |
-
<td className="px-
|
| 388 |
-
<td className="px-
|
| 389 |
</tr>
|
| 390 |
))}
|
| 391 |
</tbody>
|
|
@@ -396,32 +396,32 @@ export function MCPDataPanel({ metrics, rawData, companyName, ticker, exchange,
|
|
| 396 |
|
| 397 |
{/* Qualitative Data Table */}
|
| 398 |
{qualitativeRows.length > 0 && (
|
| 399 |
-
<div className="bg-card rounded-lg border border-border overflow-hidden">
|
| 400 |
-
<div className="px-
|
| 401 |
<h3 className="text-sm font-medium text-foreground">Qualitative Data</h3>
|
| 402 |
</div>
|
| 403 |
-
<div className="overflow-x-auto">
|
| 404 |
-
<table className="
|
| 405 |
<thead className="bg-muted/30">
|
| 406 |
<tr>
|
| 407 |
-
<th className="px-
|
| 408 |
-
<th className="px-
|
| 409 |
-
<th className="px-
|
| 410 |
-
<th className="px-
|
| 411 |
-
<th className="px-
|
| 412 |
-
<th className="px-
|
| 413 |
-
<th className="px-
|
| 414 |
</tr>
|
| 415 |
</thead>
|
| 416 |
<tbody className="divide-y divide-border">
|
| 417 |
{qualitativeRows.map((row, idx) => (
|
| 418 |
<tr key={idx} className="hover:bg-muted/20">
|
| 419 |
-
<td className="px-
|
| 420 |
-
<td className="px-
|
| 421 |
-
<td className="px-
|
| 422 |
-
<td className="px-
|
| 423 |
-
<td className="px-
|
| 424 |
-
<td className="px-
|
| 425 |
<a
|
| 426 |
href={row.url}
|
| 427 |
target="_blank"
|
|
@@ -432,7 +432,7 @@ export function MCPDataPanel({ metrics, rawData, companyName, ticker, exchange,
|
|
| 432 |
<ExternalLink className="h-3 w-3" />
|
| 433 |
</a>
|
| 434 |
</td>
|
| 435 |
-
<td className="px-
|
| 436 |
</tr>
|
| 437 |
))}
|
| 438 |
</tbody>
|
|
|
|
| 359 |
|
| 360 |
{/* Quantitative Data Table */}
|
| 361 |
{quantitativeRows.length > 0 && (
|
| 362 |
+
<div className="bg-card rounded-lg border border-border overflow-hidden w-fit">
|
| 363 |
+
<div className="px-4 py-2 bg-muted/50 border-b border-border">
|
| 364 |
<h3 className="text-sm font-medium text-foreground">Quantitative Data</h3>
|
| 365 |
</div>
|
| 366 |
+
<div className="overflow-x-auto p-2">
|
| 367 |
+
<table className="text-xs">
|
| 368 |
<thead className="bg-muted/30">
|
| 369 |
<tr>
|
| 370 |
+
<th className="px-3 py-1.5 text-left font-medium text-muted-foreground">S/N</th>
|
| 371 |
+
<th className="px-3 py-1.5 text-left font-medium text-muted-foreground">Metric</th>
|
| 372 |
+
<th className="px-3 py-1.5 text-right font-medium text-muted-foreground">Value</th>
|
| 373 |
+
<th className="px-3 py-1.5 text-left font-medium text-muted-foreground">Data Type</th>
|
| 374 |
+
<th className="px-3 py-1.5 text-left font-medium text-muted-foreground">As Of</th>
|
| 375 |
+
<th className="px-3 py-1.5 text-left font-medium text-muted-foreground">Source</th>
|
| 376 |
+
<th className="px-3 py-1.5 text-left font-medium text-muted-foreground">Category</th>
|
| 377 |
</tr>
|
| 378 |
</thead>
|
| 379 |
<tbody className="divide-y divide-border">
|
| 380 |
{quantitativeRows.map((row, idx) => (
|
| 381 |
<tr key={idx} className="hover:bg-muted/20">
|
| 382 |
+
<td className="px-3 py-1.5 text-muted-foreground">{idx + 1}</td>
|
| 383 |
+
<td className="px-3 py-1.5">{row.metric}</td>
|
| 384 |
+
<td className="px-3 py-1.5 text-right font-medium">{row.value}</td>
|
| 385 |
+
<td className="px-3 py-1.5 text-muted-foreground">{row.dataType}</td>
|
| 386 |
+
<td className="px-3 py-1.5 text-muted-foreground">{row.asOf}</td>
|
| 387 |
+
<td className="px-3 py-1.5 text-muted-foreground">{row.source}</td>
|
| 388 |
+
<td className="px-3 py-1.5">{row.category}</td>
|
| 389 |
</tr>
|
| 390 |
))}
|
| 391 |
</tbody>
|
|
|
|
| 396 |
|
| 397 |
{/* Qualitative Data Table */}
|
| 398 |
{qualitativeRows.length > 0 && (
|
| 399 |
+
<div className="bg-card rounded-lg border border-border overflow-hidden w-fit">
|
| 400 |
+
<div className="px-4 py-2 bg-muted/50 border-b border-border">
|
| 401 |
<h3 className="text-sm font-medium text-foreground">Qualitative Data</h3>
|
| 402 |
</div>
|
| 403 |
+
<div className="overflow-x-auto p-2">
|
| 404 |
+
<table className="text-xs">
|
| 405 |
<thead className="bg-muted/30">
|
| 406 |
<tr>
|
| 407 |
+
<th className="px-3 py-1.5 text-left font-medium text-muted-foreground">S/N</th>
|
| 408 |
+
<th className="px-3 py-1.5 text-left font-medium text-muted-foreground">Title</th>
|
| 409 |
+
<th className="px-3 py-1.5 text-left font-medium text-muted-foreground">Date</th>
|
| 410 |
+
<th className="px-3 py-1.5 text-left font-medium text-muted-foreground">Source</th>
|
| 411 |
+
<th className="px-3 py-1.5 text-left font-medium text-muted-foreground">Subreddit</th>
|
| 412 |
+
<th className="px-3 py-1.5 text-left font-medium text-muted-foreground">URL</th>
|
| 413 |
+
<th className="px-3 py-1.5 text-left font-medium text-muted-foreground">Category</th>
|
| 414 |
</tr>
|
| 415 |
</thead>
|
| 416 |
<tbody className="divide-y divide-border">
|
| 417 |
{qualitativeRows.map((row, idx) => (
|
| 418 |
<tr key={idx} className="hover:bg-muted/20">
|
| 419 |
+
<td className="px-3 py-1.5 text-muted-foreground">{idx + 1}</td>
|
| 420 |
+
<td className="px-3 py-1.5 max-w-[250px] truncate" title={row.title}>{row.title}</td>
|
| 421 |
+
<td className="px-3 py-1.5 text-muted-foreground">{row.date}</td>
|
| 422 |
+
<td className="px-3 py-1.5">{row.source}</td>
|
| 423 |
+
<td className="px-3 py-1.5 text-muted-foreground">{row.subreddit}</td>
|
| 424 |
+
<td className="px-3 py-1.5">
|
| 425 |
<a
|
| 426 |
href={row.url}
|
| 427 |
target="_blank"
|
|
|
|
| 432 |
<ExternalLink className="h-3 w-3" />
|
| 433 |
</a>
|
| 434 |
</td>
|
| 435 |
+
<td className="px-3 py-1.5">{row.category}</td>
|
| 436 |
</tr>
|
| 437 |
))}
|
| 438 |
</tbody>
|