Skip to content

Commit

Permalink
[front] - refactor: replace Table with DataTable in public-urls compo…
Browse files Browse the repository at this point in the history
…nent

 - Transition from Table to DataTable for consistent component use across the platform
 - Update corresponding TableData.Cell to DataTable.Cell to align with the new DataTable component usage
  • Loading branch information
Jules authored and Jules committed Aug 1, 2024
1 parent 2dcd6ec commit ce1e147
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions front/pages/w/[wId]/builder/data-sources/public-urls.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import {
Button,
DataTable,
LinkIcon,
Page,
PlusIcon,
Popup,
RobotIcon,
Searchbar,
Table,
TableData,
} from "@dust-tt/sparkle";
import { GlobeAltIcon } from "@dust-tt/sparkle";
import type { PlanType, SubscriptionType } from "@dust-tt/types";
Expand Down Expand Up @@ -220,10 +219,9 @@ export default function DataSourcesView({
/>
)}
{clickableDataSources.length > 0 && (
<Table
<DataTable
data={clickableDataSources}
columns={columns}
width="expanded"
filter={dataSourceSearch}
filterColumn={"name"}
/>
Expand All @@ -247,24 +245,24 @@ function getTableColumns() {
header: "Name",
accessorKey: "name",
cell: (info: Info) => (
<TableData.Cell icon={info.row.original.icon}>
<DataTable.Cell icon={info.row.original.icon}>
{info.row.original.name}
</TableData.Cell>
</DataTable.Cell>
),
},
{
header: "Used by",
accessorKey: "usage",
cell: (info: Info) => (
<TableData.Cell icon={RobotIcon}>
<DataTable.Cell icon={RobotIcon}>
{info.row.original.usage}
</TableData.Cell>
</DataTable.Cell>
),
},
{
header: "Added by",
cell: (info: Info) => (
<TableData.Cell
<DataTable.Cell
avatarUrl={info.row.original.editedByUser?.imageUrl ?? ""}
/>
),
Expand All @@ -273,13 +271,13 @@ function getTableColumns() {
header: "Last updated",
accessorKey: "editedByUser.editedAt",
cell: (info: Info) => (
<TableData.Cell>
<DataTable.Cell>
{info.row.original.editedByUser?.editedAt
? new Date(
info.row.original.editedByUser.editedAt
).toLocaleDateString()
: null}
</TableData.Cell>
</DataTable.Cell>
),
},
];
Expand Down

0 comments on commit ce1e147

Please sign in to comment.