work on data-table
This commit is contained in:
parent
55a01f7099
commit
47676edb13
2 changed files with 74 additions and 20 deletions
|
|
@ -101,7 +101,7 @@ export function ExchangesTable() {
|
|||
accessorKey: 'id',
|
||||
size: 80,
|
||||
cell: ({ getValue }) => (
|
||||
<span className="font-mono text-primary-400 text-xs">
|
||||
<span className="font-mono text-primary-400 text-xs block truncate">
|
||||
{getValue() as string}
|
||||
</span>
|
||||
),
|
||||
|
|
@ -112,7 +112,7 @@ export function ExchangesTable() {
|
|||
accessorKey: 'code',
|
||||
size: 100,
|
||||
cell: ({ getValue }) => (
|
||||
<span className="font-mono text-text-primary text-sm font-medium">
|
||||
<span className="font-mono text-text-primary text-sm font-medium block truncate">
|
||||
{getValue() as string}
|
||||
</span>
|
||||
),
|
||||
|
|
@ -130,7 +130,6 @@ export function ExchangesTable() {
|
|||
return (
|
||||
<input
|
||||
type="text"
|
||||
style={{ width: cell.column.getSize() }}
|
||||
value={editValue}
|
||||
onChange={e => setEditValue(e.target.value)}
|
||||
onBlur={() => handleCellEdit(row.original.id, 'name', editValue)}
|
||||
|
|
@ -150,11 +149,12 @@ export function ExchangesTable() {
|
|||
|
||||
return (
|
||||
<div
|
||||
className="cursor-pointer hover:bg-surface-secondary rounded px-2 py-1 transition-colors text-sm"
|
||||
className="cursor-pointer hover:bg-surface-secondary rounded px-2 py-1 transition-colors text-sm truncate overflow-hidden text-ellipsis whitespace-nowrap"
|
||||
onClick={() => {
|
||||
setEditingCell({ id: row.original.id, field: 'name' });
|
||||
setEditValue(getValue() as string);
|
||||
}}
|
||||
title={getValue() as string}
|
||||
>
|
||||
{getValue() as string}
|
||||
</div>
|
||||
|
|
@ -167,7 +167,7 @@ export function ExchangesTable() {
|
|||
accessorKey: 'country',
|
||||
size: 80,
|
||||
cell: ({ getValue }) => (
|
||||
<span className="text-text-secondary text-sm">{getValue() as string}</span>
|
||||
<span className="text-text-secondary text-sm block truncate">{getValue() as string}</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
|
|
@ -175,11 +175,8 @@ export function ExchangesTable() {
|
|||
header: 'Currency',
|
||||
accessorKey: 'currency',
|
||||
size: 80,
|
||||
cell: ({ getValue, cell }) => (
|
||||
<span
|
||||
className="font-mono text-text-secondary text-sm"
|
||||
style={{ width: cell.column.getSize() }}
|
||||
>
|
||||
cell: ({ getValue }) => (
|
||||
<span className="font-mono text-text-secondary text-sm block truncate">
|
||||
{getValue() as string}
|
||||
</span>
|
||||
),
|
||||
|
|
@ -189,13 +186,10 @@ export function ExchangesTable() {
|
|||
header: 'Active',
|
||||
accessorKey: 'active',
|
||||
size: 80,
|
||||
cell: ({ getValue, row, cell }) => {
|
||||
cell: ({ getValue, row }) => {
|
||||
const isActive = getValue() as boolean;
|
||||
return (
|
||||
<label
|
||||
className="relative inline-flex items-center cursor-pointer"
|
||||
style={{ width: cell.column.getSize() }}
|
||||
>
|
||||
<label className="relative inline-flex items-center cursor-pointer">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={isActive}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue