mirror of
https://github.com/pawelmalak/flame.git
synced 2026-03-06 20:43:13 +08:00
Split BookmarksTable into separate components. Minor changes to reducers
This commit is contained in:
20
client/src/components/Bookmarks/Table/Table.tsx
Normal file
20
client/src/components/Bookmarks/Table/Table.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Category, Bookmark } from '../../../interfaces';
|
||||
import { ContentType } from '../Bookmarks';
|
||||
import { BookmarksTable } from './BookmarksTable';
|
||||
import { CategoryTable } from './CategoryTable';
|
||||
|
||||
interface Props {
|
||||
contentType: ContentType;
|
||||
openFormForUpdating: (data: Category | Bookmark) => void;
|
||||
}
|
||||
|
||||
export const Table = (props: Props): JSX.Element => {
|
||||
const tableEl =
|
||||
props.contentType === ContentType.category ? (
|
||||
<CategoryTable openFormForUpdating={props.openFormForUpdating} />
|
||||
) : (
|
||||
<BookmarksTable openFormForUpdating={props.openFormForUpdating} />
|
||||
);
|
||||
|
||||
return tableEl;
|
||||
};
|
||||
Reference in New Issue
Block a user