Skip to content

Commit

Permalink
empty-component-props
Browse files Browse the repository at this point in the history
  • Loading branch information
Samvel Baghdasaryan committed Dec 26, 2024
1 parent 18467fc commit 1f66f2e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 23 deletions.
3 changes: 2 additions & 1 deletion src/Models/table.models.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ReactNode } from 'react'
import { ColumnTypeEnums } from './table.enum'

export interface IProps<T extends Object> {
Expand Down Expand Up @@ -36,7 +37,7 @@ export interface IProps<T extends Object> {
rowsFreezeAction?: boolean
isEnableAggregates?: boolean
aggregates?: any
emptyDataIcon?: string
EmptyDataContainer?: ReactNode
perColumnTotalCount?: number
hoverdRowPosition?: number
selectedPageSizeId?: ISelected
Expand Down
15 changes: 8 additions & 7 deletions src/table/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,13 @@
}
}

.G-empty-data-component{

}



#table-wrapper{
position: relative;
}
.empty-container{
position: absolute;
left: 50%;
transform: translateX(-50%);
top:25%
}
}

17 changes: 2 additions & 15 deletions src/table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function Table<T extends Object>({
filterColumns,
filtersTypes,
rowsFreezeAction,
emptyDataIcon,
EmptyDataContainer,
perColumnTotalCount,
selectedPageSizeId,
hasFilters,
Expand Down Expand Up @@ -90,20 +90,7 @@ function Table<T extends Object>({

return (
<div id='table-wrapper'>
{!isLoadedData && !data.length ? (
<img
style={{
position: 'absolute',
left: '50%',
transform: 'translateX(-50%)',
top: '25%',
}}
className='G-empty-data-icon'
src={emptyDataIcon}
alt='Empty data'
width={500}
/>
) : null}
{!isLoadedData && !data.length ? <div className='empty-container'>{EmptyDataContainer}</div> : null}
{multipleCheck || draggableColumns || hasFilters || getDownloadType ? (
<MainHeader
columnsConfigStructure={columnsConfigStructure}
Expand Down

0 comments on commit 1f66f2e

Please sign in to comment.