Skip to content

Commit

Permalink
improve TableRowData type exports and imports
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarabashh committed Dec 6, 2024
1 parent 09e8b22 commit 7330996
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/DataTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {

import { trackCustomEvent } from "@/lib/utils/matomo"

interface TableRowData {
export interface TableRowData {
name: string
id?: string | number
description?: string
Expand Down
6 changes: 3 additions & 3 deletions src/components/ProductTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import { ColumnDef } from "@tanstack/react-table"

import type { FilterOption, TPresetFilters } from "@/lib/types"

import Table from "@/components/DataTable"
import Table, { TableRowData } from "@/components/DataTable"
import Filters from "@/components/ProductTable/Filters"
import MobileFilters from "@/components/ProductTable/MobileFilters"
import PresetFilters from "@/components/ProductTable/PresetFilters"

import { trackCustomEvent } from "@/lib/utils/matomo"

interface ProductTableProps<T> {
interface ProductTableProps<T extends TableRowData> {
columns: ColumnDef<T>[]
data: T[]
allDataLength: number
Expand All @@ -33,7 +33,7 @@ interface ProductTableProps<T> {
meta?: Record<string, string | number | boolean>
}

const ProductTable = <T,>({
const ProductTable = <T extends TableRowData>({
columns,
data,
allDataLength,
Expand Down

0 comments on commit 7330996

Please sign in to comment.