You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.0 KiB
TypeScript
46 lines
1.0 KiB
TypeScript
5 years ago
|
import React from 'react';
|
||
|
import classNames from 'classnames';
|
||
|
|
||
|
import { SessionDropdownItem, SessionDropDownItemType } from './SessionDropdownItem';
|
||
|
import { SessionIconType } from './icon/';
|
||
|
|
||
|
|
||
|
interface Props {
|
||
|
items: Array<{
|
||
|
id: string,
|
||
|
content: string,
|
||
|
icon: SessionIconType | null,
|
||
|
type: SessionDropDownItemType,
|
||
|
active: boolean,
|
||
|
}>,
|
||
|
}
|
||
|
|
||
|
export class SessionDropdown extends React.PureComponent<Props> {
|
||
|
public static readonly defaultProps = SessionDropdownItem.defaultProps;
|
||
|
|
||
|
constructor(props: any) {
|
||
|
super(props);
|
||
|
}
|
||
|
|
||
|
public render() {
|
||
|
const { items } = this.props;
|
||
|
|
||
|
return (
|
||
|
<div className={classNames('session-dropdown')}>
|
||
|
<ul>
|
||
|
{items.map((item: any) => <SessionDropdownItem
|
||
|
id={item.id}
|
||
|
content={item.content}
|
||
|
icon={item.icon}
|
||
|
type={item.type}
|
||
|
active={item.active}
|
||
|
/>
|
||
|
)}
|
||
|
</ul>
|
||
|
</div>
|
||
|
);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|