1313 * See the License for the specific language governing permissions and
1414 * limitations under the License.
1515 */
16- import { useState } from 'react' ;
17-
18- import * as React from 'react' ;
16+ import { useContext , useEffect , useState } from 'react' ;
1917
2018import { ErrorBoundary } from '@backstage/core-components' ;
2119import { RequirePermission } from '@backstage/plugin-permission-react' ;
@@ -50,7 +48,7 @@ type ViewLogsProps = {
5048} ;
5149
5250const ViewLogs = ( { podData, onClose } : ViewLogsProps ) => {
53- const { clusters, selectedCluster } = React . useContext ( K8sResourcesContext ) ;
51+ const { clusters, selectedCluster } = useContext ( K8sResourcesContext ) ;
5452 const [ logText , setLogText ] = useState < string > ( '' ) ;
5553
5654 const curCluster =
@@ -63,8 +61,8 @@ const ViewLogs = ({ podData, onClose }: ViewLogsProps) => {
6361 ( containersList ?. length && ( containersList ?. [ 0 ] . name ?? '' ) ) || '' ;
6462
6563 const [ containerSelected , setContainerSelected ] =
66- React . useState < string > ( curContainer ) ;
67- const [ podScope , setPodScope ] = React . useState < ContainerScope > ( {
64+ useState < string > ( curContainer ) ;
65+ const [ podScope , setPodScope ] = useState < ContainerScope > ( {
6866 containerName : curContainer ,
6967 podName,
7068 podNamespace : podNamespace ,
@@ -75,7 +73,7 @@ const ViewLogs = ({ podData, onClose }: ViewLogsProps) => {
7573 setContainerSelected ( event . target . value ) ;
7674 } ;
7775
78- React . useEffect ( ( ) => {
76+ useEffect ( ( ) => {
7977 if ( containerSelected ) {
8078 setPodScope ( ps => ( {
8179 ...ps ,
@@ -146,7 +144,7 @@ const ViewLogs = ({ podData, onClose }: ViewLogsProps) => {
146144
147145export const PodLogsDialog = ( { podData } : PodLogsDialogProps ) => {
148146 const { t } = useTranslation ( ) ;
149- const { clusters, selectedCluster } = React . useContext ( K8sResourcesContext ) ;
147+ const { clusters, selectedCluster } = useContext ( K8sResourcesContext ) ;
150148 const [ open , setOpen ] = useState < boolean > ( false ) ;
151149
152150 const curCluster =
0 commit comments