+ {!this.props.id &&
+ !this.props.disableCreate &&
+ !this.props.showCreateSegment &&
+ !this.props.readOnly && (
+
+
+ this.setState({ selectedSegment }, this.addItem)
+ }
+ />
+
+ )}
+ {!this.props.showCreateSegment &&
+ !this.props.readOnly &&
+ !this.props.disableCreate && (
+
+
+ )}
+ {this.props.showCreateSegment && !this.state.segmentEditId && (
+
+ {
+ this.props.setShowCreateSegment(false)
+ if (!this.state.selectedSegment) {
+ this.setState(
+ {
+ selectedSegment: {
+ label: segment.name,
+ value: segment.id,
+ },
+ },
+ this.addItem,
+ )
+ }
+ }}
+ onCancel={() => {
+ this.props.setShowCreateSegment(false)
+ }}
+ condensed
+ feature={this.props.feature}
+ environmentId={this.props.environmentId}
+ projectId={this.props.projectId}
/>
)}
+ {this.props.showCreateSegment && this.state.segmentEditId && (
+
{
+ this.setState({
+ segmentEditId: undefined,
+ })
+ this.props.setShowCreateSegment(false)
+ }}
+ onCancel={() => {
+ this.setState({ segmentEditId: undefined })
+ this.props.setShowCreateSegment(false)
+ }}
+ environmentId={this.props.environmentId}
+ projectId={this.props.projectId}
+ />
+ )}
+ {visibleValues &&
+ !!visibleValues.length &&
+ !this.props.showCreateSegment && (
+
+ {!this.props.id && (
+
+
+ Prioritise a segment override by dragging it to the
+ top of the list.
+
+ Segment overrides will only apply when you identify
+ via the SDK.{' '}
+
+ Check the Docs for more details
+
+ .
+
+
+
+ )}
- {value && (
- <>
-
({
- ...v,
- }))}
- setSegmentEditId={this.setSegmentEditId}
- onSortEnd={this.onSortEnd}
- projectFlag={this.props.projectFlag}
- />
-
-
+ {value && (
+ <>
+
({
+ ...v,
+ }))}
+ setSegmentEditId={this.setSegmentEditId}
+ onSortEnd={this.onSortEnd}
+ projectFlag={this.props.projectFlag}
+ />
+
+
+
+ >
+ )}
- >
- )}
+ )}
- )}
-
+ )
+ }}
+