-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathSelectTrigger.js
More file actions
29 lines (28 loc) · 772 Bytes
/
SelectTrigger.js
File metadata and controls
29 lines (28 loc) · 772 Bytes
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
import React, { Component } from 'react';
import RenderOption from './RenderOption';
import TriggerWrapper from './TriggerWrapper';
export default function Trigger({
selectedOption,
optionLabelPath,
selectedOptionComponent,
placeholder,
select,
...rest
}) {
return (
<TriggerWrapper value={selectedOption} select={select} {...rest}>
<div className="PowerSelect__TriggerLabel">
{selectedOption ? (
<RenderOption
option={selectedOption}
optionLabelPath={optionLabelPath}
optionComponent={selectedOptionComponent}
select={select}
/>
) : (
<span className="PowerSelect__Placeholder">{placeholder}</span>
)}
</div>
</TriggerWrapper>
);
}