77 * License v3.0 only", or the "Server Side Public License, v 1".
88 */
99
10- import React , { useCallback , useEffect , useMemo , useRef , useState } from 'react' ;
10+ import React , { useCallback , useMemo } from 'react' ;
1111import {
1212 EuiFormRow ,
1313 EuiFieldText ,
@@ -20,8 +20,6 @@ import { RULE_NAME_INPUT_TITLE, RULE_TAG_INPUT_TITLE, RULE_TAG_PLACEHOLDER } fro
2020import { useRuleFormState , useRuleFormDispatch } from '../hooks' ;
2121import { OptionalFieldLabel } from '../optional_field_label' ;
2222
23- export const RULE_DETAIL_MIN_ROW_WIDTH = 600 ;
24-
2523export const RuleDetails = ( ) => {
2624 const { formData, baseErrors } = useRuleFormState ( ) ;
2725
@@ -72,13 +70,8 @@ export const RuleDetails = () => {
7270 }
7371 } , [ dispatch , tags ] ) ;
7472
75- const {
76- ref,
77- size : { width } ,
78- } = useContainerRef ( ) ;
79-
8073 return (
81- < EuiFlexGroup ref = { ref } direction = { width > RULE_DETAIL_MIN_ROW_WIDTH ? 'row' : 'column' } >
74+ < EuiFlexGroup >
8275 < EuiFlexItem >
8376 < EuiFormRow
8477 data-test-subj = "ruleDetails"
@@ -119,23 +112,3 @@ export const RuleDetails = () => {
119112 </ EuiFlexGroup >
120113 ) ;
121114} ;
122-
123- function useContainerRef ( ) {
124- const ref = useRef < HTMLDivElement | null > ( null ) ;
125- const [ size , setSize ] = useState ( { width : 0 , height : 0 } ) ;
126-
127- useEffect ( ( ) => {
128- if ( ! ref . current ) return ;
129-
130- const observer = new ResizeObserver ( ( [ entry ] ) => {
131- const { width, height } = entry . contentRect ;
132- setSize ( { width, height } ) ;
133- } ) ;
134-
135- observer . observe ( ref . current ) ;
136-
137- return observer . disconnect ;
138- } , [ ] ) ;
139-
140- return { ref, size } ;
141- }
0 commit comments