-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_tabs.jsx
45 lines (44 loc) · 1.39 KB
/
_tabs.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import React from 'react'
import { Grid, Cell, TabsContainer, Tabs, Tab, Avatar } from 'react-md'
export default ({ selectedIds, currentIndex, updateCurrentIndex, id, children, ...props }) => (
<div id={id}>
<Grid noSpacing>
<Cell size={12}>
{selectedIds.length > 0 ? (
<TabsContainer
activeTabIndex={currentIndex}
onTabChange={newTabIndex => updateCurrentIndex(newTabIndex)}
>
<Tabs className="tabs-header" tabId={id}>
{selectedIds.map((id, i) => (
<Tab
className={'hello-world'}
key={i}
icon={
<Avatar
key={i}
style={{ backgroundColor: '#b1d0b6ed' }}
contentStyle={{ fontSize: '10px' }}
suffix="grey"
iconSized
>
{id}
</Avatar>
}
>
{children({ id })}
</Tab>
))}
</Tabs>
</TabsContainer>
) : (
<Grid>
<Cell size={12} style={{ minHeight: '300px' }}>
<p>Select one or more {props.location.pathname.replace('/', '')} from the table</p>
</Cell>
</Grid>
)}
</Cell>
</Grid>
</div>
)