Skip to content

Commit

Permalink
chore: update names
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-Liendo committed Aug 16, 2024
1 parent 9286258 commit d39c028
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
18 changes: 16 additions & 2 deletions client/src/components/datagrids/links/links-columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const linksColumns: ColumnDef<z.infer<typeof LinkSchema>>[] = [
{
accessorKey: 'created_at',
header: ({ column }) => (
<DataTableColumnHeader column={column} title="created at" />
<DataTableColumnHeader column={column} title="Created at" />
),
cell: ({ row }) => {
return (
Expand All @@ -87,7 +87,21 @@ export const linksColumns: ColumnDef<z.infer<typeof LinkSchema>>[] = [
);
},
},

{
accessorKey: 'updated_at',
header: ({ column }) => (
<DataTableColumnHeader column={column} title="Update date" />
),
cell: ({ row }) => {
return (
<div className="flex space-x-2">
<span className="max-w-[500px] truncate font-medium">
{row.original.updated_at.toLocaleString()}
</span>
</div>
);
},
},
{
id: 'actions',
cell: ({ row }) => <DataTableRowActions row={row} />,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import { DotsHorizontalIcon } from '@radix-ui/react-icons';
import type { Row } from '@tanstack/react-table';

Expand All @@ -18,11 +20,15 @@ import {

import { LinkSchema } from '@linx/shared';

interface _DataTableRowActionsProps<TData> {
interface DataTableRowActionsProps<TData> {
row: Row<TData>;
}

export function DataTableRowActions<_TData>() {
export function DataTableRowActions<TData>({
row,
}: DataTableRowActionsProps<TData>) {
const _link = LinkSchema.parse(row.original);

return (
<DropdownMenu>
<DropdownMenuTrigger asChild>
Expand All @@ -36,8 +42,6 @@ export function DataTableRowActions<_TData>() {
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="w-[160px]">
<DropdownMenuItem>Edit</DropdownMenuItem>
<DropdownMenuItem>Make a copy</DropdownMenuItem>
<DropdownMenuItem>Favorite</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem>
Delete
Expand Down

0 comments on commit d39c028

Please sign in to comment.