Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import styles from './PanelDropdown.css';
import React from 'react';
import classnames from 'classnames';
import Dropdown from 'views/shared/Components/DropDown/DropDown';
import { getIconByType } from 'views/shared/Components/SingleEvent/SingleEvent';
const PanelDropdown = (props) =>
<div>
<Dropdown
{...props}
searchable
optionRenderer={renderOption}
className={styles.dropdown}
clearable={false}
/>
</div>;
const renderOption = (option) => {
const icon = option.iconType ? getIconByType(option.iconType) : null;
return (
<div className={classnames(styles.option, {[styles.header]: option.disable})}>
<span>{option.label}</span>
{
icon &&
<span>{icon}</span>
}
{
option.description &&
<span>{option.description}</span>
}
</div>
);
};
export default PanelDropdown;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment