import React from 'react'; import classNames from 'classnames'; import { SessionToggle } from '../SessionToggle'; import { SessionButton } from '../SessionButton'; import { SessionSettingType } from './SessionSettings'; import { SessionRadioGroup } from '../SessionRadioGroup'; interface Props { title: string; description?: string; type: SessionSettingType; value: any; options?: Array; onClick?: any; content: any; } export class SessionSettingListItem extends React.Component { public static defaultProps = { inline: true, }; public constructor(props: Props) { super(props); this.state = {}; this.handleClick = this.handleClick.bind(this); } public render(): JSX.Element { const { title, description, type, value, content } = this.props; const inline = ![ SessionSettingType.Options, SessionSettingType.Slider, ].includes(type); return (
{title}
{description && (
{description}
)}
{type === SessionSettingType.Toggle && (
)} {type === SessionSettingType.Button && ( )} {type === SessionSettingType.Options && ( )}
); } private handleClick() { this.props.onClick && this.props.onClick(); } }