Skip to content

Instantly share code, notes, and snippets.

@waptik
Last active March 25, 2022 10:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save waptik/6b40ea4c8a6f90ae8446a33fd2cb4441 to your computer and use it in GitHub Desktop.
Save waptik/6b40ea4c8a6f90ae8446a33fd2cb4441 to your computer and use it in GitHub Desktop.
// Copy to: src/types/react-table-config.d.ts
export * from '@saas-ui/data-table/src/react-table-config.d'
import { Column, DataTable } from '@saas-ui/react';
interface ExampleData {
id: string
name: string
email: string
}
const columns: Column<ExampleData>[] = [
{
accessor: 'id',
Header: 'Id',
},
{
accessor: 'name',
Header: 'Name',
},
{
accessor: 'email',
Header: 'Email',
},
]
const data: ExampleData[] = [{
{
id: 1,
name: 'TaShya Charles',
email: 'urna.nec.luctus@icloud.couk'
},
{
id: 2,
name: 'Donovan Mosley',
email: 'lacinia.mattis.integer@icloud.couk',
},
}]
const TryDataTable = () => {
return <DataTable<ExampleData> columns={columns} data={data} />
}
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"strictNullChecks": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"useUnknownInCatchVariables": true,
"allowSyntheticDefaultImports": true,
"downlevelIteration": true,
"types": ["@types/jest"],
"incremental": true,
"baseUrl": ".",
"paths": {
"~/*": ["src/*"],
"~components/*": ["src/components/*"],
"~utils/*": ["src/utils/*"],
"~server/*": ["src/server/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"],
"ts-node": {
"compilerOptions": {
"module": "CommonJS",
"types": ["node"]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment