From 941a99301ef1b3871c0ff3bafefeaddfc5f83904 Mon Sep 17 00:00:00 2001 From: Grzegorz Zdunek Date: Fri, 13 Dec 2024 16:12:14 +0100 Subject: [PATCH 1/6] Remove unused `React` imports from `packages/shared` (#50207) --- .../AccessDuration/AccessDurationRequest.tsx | 1 - .../AccessDuration/AccessDurationReview.tsx | 1 - .../AssumeStartTime/AssumeStartTime.story.tsx | 2 +- .../AccessRequests/NewRequest/CheckableOption.tsx | 1 - .../NewRequest/RequestCheckout/AdditionalOptions.tsx | 2 +- .../RequestCheckout/RequestCheckout.story.tsx | 2 +- .../NewRequest/RequestCheckout/SelectReviewers.tsx | 4 ++-- .../RequestView/RequestDelete/RequestDelete.story.tsx | 2 -- .../RequestView/RequestDelete/RequestDelete.tsx | 1 - .../RequestView/RequestReview/RequestReview.story.tsx | 2 -- .../ReviewRequests/RequestView/RequestView.story.tsx | 2 -- .../ReviewRequests/RequestView/RequestView.tsx | 6 +++--- .../ReviewRequests/RequestView/RolesRequested.tsx | 1 - .../shared/components/AccessRequests/Shared/Shared.tsx | 2 +- .../AdvancedSearchToggle.story.tsx | 2 +- .../AdvancedSearchToggle/AdvancedSearchToggle.tsx | 2 -- .../components/AnimatedTerminal/AnimatedTerminal.tsx | 2 +- .../components/AnimatedTerminal/TerminalContent.tsx | 10 +++++----- .../shared/components/ButtonSso/ButtonSso.story.tsx | 2 -- .../shared/components/ButtonSso/ButtonSso.test.tsx | 1 - web/packages/shared/components/ButtonSso/ButtonSso.tsx | 2 +- .../ButtonTextWithAddIcon.story.tsx | 2 +- .../ButtonTextWithAddIcon.test.tsx | 2 -- .../ButtonTextWithAddIcon/ButtonTextWithAddIcon.tsx | 1 - .../ClusterDropdown/ClusterDropdown.story.tsx | 1 - .../shared/components/Controls/ViewModeSwitch.tsx | 1 - .../DownloadConnect/DownloadConnect.story.tsx | 1 - web/packages/shared/components/Editor/Tabs.tsx | 1 - .../components/FieldCheckbox/FieldCheckbox.story.tsx | 2 -- .../shared/components/FieldInput/FieldInput.story.tsx | 2 -- .../shared/components/FieldInput/FieldInput.test.tsx | 1 - .../FieldMultiInput/FieldMultiInput.story.tsx | 2 +- .../FieldMultiInput/FieldMultiInput.test.tsx | 2 +- .../shared/components/FieldSelect/FieldSelect.test.tsx | 1 - .../FieldSelect/FieldSelectCreatable.test.tsx | 1 - .../components/FieldTextArea/FieldTextArea.story.tsx | 2 -- .../components/FileTransfer/FileTransfer.test.tsx | 1 - .../shared/components/FileTransfer/FileTransfer.tsx | 2 -- .../components/FileTransfer/FileTransferActionBar.tsx | 1 - .../FileTransfer/FileTransferContextProvider.tsx | 2 +- .../FileTransfer/FileTransferRequests.story.tsx | 2 -- .../components/FileTransfer/FileTransferRequests.tsx | 1 - .../DownloadForm/DownloadForm.test.tsx | 1 - .../DownloadForm/DownloadForm.tsx | 2 +- .../FileTransferStateless/FileList/FileList.test.tsx | 1 - .../FileTransferStateless/FileList/FileList.tsx | 1 - .../FileTransferStateless/FileList/FileListItem.tsx | 2 +- .../FileTransferStateless.story.tsx | 2 -- .../FileTransferStateless/FileTransferStateless.tsx | 1 - .../UploadForm/UploadForm.test.tsx | 1 - .../shared/components/Highlight/Highlight.story.tsx | 1 - web/packages/shared/components/Highlight/Highlight.tsx | 1 - .../shared/components/MenuAction/MenuAction.story.tsx | 1 - .../shared/components/MenuAction/MenuAction.test.tsx | 1 - .../shared/components/MenuLogin/MenuLogin.test.tsx | 1 - .../components/Notification/Notification.story.tsx | 2 +- .../shared/components/Search/SearchPagination.tsx | 1 - web/packages/shared/components/Search/SearchPanel.tsx | 2 +- web/packages/shared/components/Select/Select.tsx | 1 - .../shared/components/Select/SelectCreatable.story.tsx | 10 +++++----- .../shared/components/TextEditor/TextEditor.jsx | 4 ++-- .../shared/components/TextEditor/TextEditor.story.tsx | 2 -- .../shared/components/TextEditor/TextEditor.test.tsx | 1 - .../components/TextSelectCopy/TextSelectCopy.story.tsx | 2 -- .../TextSelectCopy/TextSelectCopyMulti.story.tsx | 2 -- .../TextSelectCopy/TextSelectCopyMulti.test.tsx | 2 -- .../components/TextSelectCopy/TextSelectCopyMulti.tsx | 2 +- .../UnifiedResources/CardsView/CardsView.tsx | 1 - .../UnifiedResources/CardsView/LoadingCard.tsx | 2 +- .../UnifiedResources/CardsView/ResourceCard.story.tsx | 1 - .../UnifiedResources/CardsView/ResourceCard.tsx | 2 +- .../components/UnifiedResources/ListView/ListView.tsx | 2 -- .../UnifiedResources/ListView/LoadingListItem.tsx | 2 +- .../ListView/ResourceListItem.story.tsx | 1 - .../UnifiedResources/ListView/ResourceListItem.tsx | 2 +- .../shared/components/UnifiedResources/ResourceTab.tsx | 1 - .../UnifiedResources/UnifiedResources.story.tsx | 2 +- .../components/UnifiedResources/shared/CopyButton.tsx | 2 +- .../UnifiedResources/shared/LoadingSkeleton.tsx | 2 +- .../components/UnifiedResources/shared/PinButton.tsx | 2 +- .../shared/components/Validation/Validation.test.tsx | 1 - web/packages/shared/components/Validation/useRule.js | 6 +++--- .../shared/components/Validation/useRule.test.js | 2 -- .../shared/components/Window/WindowTitleBar.tsx | 2 -- web/packages/shared/hooks/useAttempt.ts | 6 +++--- web/packages/shared/hooks/useAttemptNext.ts | 4 ++-- .../hooks/useInfiniteScroll/useInfiniteScroll.test.tsx | 2 -- .../hooks/useRefAutoFocus/useRefAutoFocus.test.tsx | 2 +- .../useRefClickOutside/useRefClickOutside.test.tsx | 2 +- web/packages/shared/libs/mergeRefs.test.tsx | 10 +++++----- web/packages/shared/libs/stores/useStore.test.tsx | 2 -- web/packages/shared/libs/stores/useStore.ts | 8 ++++---- 92 files changed, 60 insertions(+), 137 deletions(-) diff --git a/web/packages/shared/components/AccessRequests/AccessDuration/AccessDurationRequest.tsx b/web/packages/shared/components/AccessRequests/AccessDuration/AccessDurationRequest.tsx index 35cfac569c462..a751566765c27 100644 --- a/web/packages/shared/components/AccessRequests/AccessDuration/AccessDurationRequest.tsx +++ b/web/packages/shared/components/AccessRequests/AccessDuration/AccessDurationRequest.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import { Flex, LabelInput, Text } from 'design'; import { IconTooltip } from 'design/Tooltip'; diff --git a/web/packages/shared/components/AccessRequests/AccessDuration/AccessDurationReview.tsx b/web/packages/shared/components/AccessRequests/AccessDuration/AccessDurationReview.tsx index 426cb1ca81729..39c2c77c0a954 100644 --- a/web/packages/shared/components/AccessRequests/AccessDuration/AccessDurationReview.tsx +++ b/web/packages/shared/components/AccessRequests/AccessDuration/AccessDurationReview.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import { Flex, Text } from 'design'; import { IconTooltip } from 'design/Tooltip'; diff --git a/web/packages/shared/components/AccessRequests/AssumeStartTime/AssumeStartTime.story.tsx b/web/packages/shared/components/AccessRequests/AssumeStartTime/AssumeStartTime.story.tsx index f33c43f4892b8..d20ea9527bc00 100644 --- a/web/packages/shared/components/AccessRequests/AssumeStartTime/AssumeStartTime.story.tsx +++ b/web/packages/shared/components/AccessRequests/AssumeStartTime/AssumeStartTime.story.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import React, { useState } from 'react'; +import { useState } from 'react'; import { Box, Text } from 'design'; diff --git a/web/packages/shared/components/AccessRequests/NewRequest/CheckableOption.tsx b/web/packages/shared/components/AccessRequests/NewRequest/CheckableOption.tsx index 510e889ba6c61..46b29b8333b26 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/CheckableOption.tsx +++ b/web/packages/shared/components/AccessRequests/NewRequest/CheckableOption.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import { Flex, Text } from 'design'; import { components, OptionProps } from 'react-select'; diff --git a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/AdditionalOptions.tsx b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/AdditionalOptions.tsx index f27c721e77914..2d6f89e019c02 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/AdditionalOptions.tsx +++ b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/AdditionalOptions.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import React, { useState } from 'react'; +import { useState } from 'react'; import { Flex, Text, ButtonIcon, Box, LabelInput } from 'design'; import * as Icon from 'design/Icon'; diff --git a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/RequestCheckout.story.tsx b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/RequestCheckout.story.tsx index 88d76f0183fab..55ef62d05b61a 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/RequestCheckout.story.tsx +++ b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/RequestCheckout.story.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import React, { useState } from 'react'; +import { useState } from 'react'; import { MemoryRouter, Link } from 'react-router-dom'; import { Box, ButtonPrimary, ButtonText } from 'design'; diff --git a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/SelectReviewers.tsx b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/SelectReviewers.tsx index aedade1435fe7..b1ea398954d48 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/SelectReviewers.tsx +++ b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/SelectReviewers.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import React, { useState, useRef } from 'react'; +import { useEffect, useState, useRef } from 'react'; import { components } from 'react-select'; import ReactSelectCreatable from 'react-select/creatable'; import styled from 'styled-components'; @@ -40,7 +40,7 @@ export function SelectReviewers({ () => reviewers.map(r => ({ value: r, label: r, isDisabled: true })) ); - React.useEffect(() => { + useEffect(() => { // When editing reviewers, auto focus on input box. if (editReviewers) { reactSelectRef.current.focus(); diff --git a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestDelete/RequestDelete.story.tsx b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestDelete/RequestDelete.story.tsx index 52482cc5f1274..2e947ab2b8dfd 100644 --- a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestDelete/RequestDelete.story.tsx +++ b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestDelete/RequestDelete.story.tsx @@ -16,8 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; - import { makeEmptyAttempt, makeProcessingAttempt, diff --git a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestDelete/RequestDelete.tsx b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestDelete/RequestDelete.tsx index 447da3448da94..8870401c429c6 100644 --- a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestDelete/RequestDelete.tsx +++ b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestDelete/RequestDelete.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import { ButtonWarning, ButtonSecondary, Flex, Alert } from 'design'; import TextSelectCopy from 'teleport/components/TextSelectCopy'; diff --git a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestReview/RequestReview.story.tsx b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestReview/RequestReview.story.tsx index 7348178391c47..f755aa1106e31 100644 --- a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestReview/RequestReview.story.tsx +++ b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestReview/RequestReview.story.tsx @@ -16,8 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; - import { makeSuccessAttempt, makeEmptyAttempt, diff --git a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestView.story.tsx b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestView.story.tsx index 5880a1f5c94ee..3feab1d9a952c 100644 --- a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestView.story.tsx +++ b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestView.story.tsx @@ -16,8 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; - import { makeSuccessAttempt, makeEmptyAttempt, diff --git a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestView.tsx b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestView.tsx index 9a3e424787378..e6655f64668ac 100644 --- a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestView.tsx +++ b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RequestView.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import React from 'react'; +import { Fragment } from 'react'; import styled from 'styled-components'; import { Alert, @@ -617,7 +617,7 @@ function Reviews({ reviews }: { reviews: AccessRequestReview[] }) { review; return ( - + )} - + ); }); diff --git a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RolesRequested.tsx b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RolesRequested.tsx index 40716141f6339..ccdeb3bcd6c1b 100644 --- a/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RolesRequested.tsx +++ b/web/packages/shared/components/AccessRequests/ReviewRequests/RequestView/RolesRequested.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import { Box, Label } from 'design'; export default function RolesRequested({ roles }: { roles: string[] }) { diff --git a/web/packages/shared/components/AccessRequests/Shared/Shared.tsx b/web/packages/shared/components/AccessRequests/Shared/Shared.tsx index 2159f6309c95e..eb8b9ef0bf86a 100644 --- a/web/packages/shared/components/AccessRequests/Shared/Shared.tsx +++ b/web/packages/shared/components/AccessRequests/Shared/Shared.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import React, { useState } from 'react'; +import { useState } from 'react'; import { ButtonPrimary, Text, Box, ButtonIcon, Menu } from 'design'; import { Info } from 'design/Icon'; import { displayDateWithPrefixedTime } from 'design/datetime'; diff --git a/web/packages/shared/components/AdvancedSearchToggle/AdvancedSearchToggle.story.tsx b/web/packages/shared/components/AdvancedSearchToggle/AdvancedSearchToggle.story.tsx index b2efff7f98c3c..0ce3d0dd52b98 100644 --- a/web/packages/shared/components/AdvancedSearchToggle/AdvancedSearchToggle.story.tsx +++ b/web/packages/shared/components/AdvancedSearchToggle/AdvancedSearchToggle.story.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import React, { useState } from 'react'; +import { useState } from 'react'; import { AdvancedSearchToggle } from './AdvancedSearchToggle'; diff --git a/web/packages/shared/components/AdvancedSearchToggle/AdvancedSearchToggle.tsx b/web/packages/shared/components/AdvancedSearchToggle/AdvancedSearchToggle.tsx index ea37fe2de003d..36a607dbbc5ea 100644 --- a/web/packages/shared/components/AdvancedSearchToggle/AdvancedSearchToggle.tsx +++ b/web/packages/shared/components/AdvancedSearchToggle/AdvancedSearchToggle.tsx @@ -16,8 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; - import { Text, Toggle, Link, Flex, H2 } from 'design'; import { P } from 'design/Text/Text'; diff --git a/web/packages/shared/components/AnimatedTerminal/AnimatedTerminal.tsx b/web/packages/shared/components/AnimatedTerminal/AnimatedTerminal.tsx index d2923a8ae5029..3a320d93dc248 100644 --- a/web/packages/shared/components/AnimatedTerminal/AnimatedTerminal.tsx +++ b/web/packages/shared/components/AnimatedTerminal/AnimatedTerminal.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import React, { useEffect, useMemo, useRef, useState } from 'react'; +import { useEffect, useMemo, useRef, useState } from 'react'; import { KeywordHighlight, diff --git a/web/packages/shared/components/AnimatedTerminal/TerminalContent.tsx b/web/packages/shared/components/AnimatedTerminal/TerminalContent.tsx index b025bb8e0e80e..5e231094578ea 100644 --- a/web/packages/shared/components/AnimatedTerminal/TerminalContent.tsx +++ b/web/packages/shared/components/AnimatedTerminal/TerminalContent.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import React, { useEffect, useLayoutEffect, useRef } from 'react'; +import { Fragment, useEffect, useLayoutEffect, useRef } from 'react'; import styled from 'styled-components'; import { BufferEntry } from 'shared/components/AnimatedTerminal/content'; @@ -125,14 +125,14 @@ function renderLines(lines: BufferEntry[], highlights?: KeywordHighlight[]) { } const result = lines.map(line => ( - + {line.isCommand ? ( ${line.text.length > 0 ? ' ' : ''} ) : null} {formatText(line.text, line.isCommand, highlights)} {line.isCurrent && line.isCommand ? : null}
-
+ )); return result; @@ -193,7 +193,7 @@ function formatText( outer: for (const [index, word] of words.entries()) { if (!isCommand && /(https?:\/\/\S+)/g.test(word)) { result.push( - + {word} {' '} - + ); continue; diff --git a/web/packages/shared/components/ButtonSso/ButtonSso.story.tsx b/web/packages/shared/components/ButtonSso/ButtonSso.story.tsx index 7d87e3963bb0c..52a6de6d1c41d 100644 --- a/web/packages/shared/components/ButtonSso/ButtonSso.story.tsx +++ b/web/packages/shared/components/ButtonSso/ButtonSso.story.tsx @@ -16,8 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; - import ButtonSso from './ButtonSso'; export default { diff --git a/web/packages/shared/components/ButtonSso/ButtonSso.test.tsx b/web/packages/shared/components/ButtonSso/ButtonSso.test.tsx index fb337001d13b8..aefdc8d5360ba 100644 --- a/web/packages/shared/components/ButtonSso/ButtonSso.test.tsx +++ b/web/packages/shared/components/ButtonSso/ButtonSso.test.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import { screen } from '@testing-library/react'; import { render } from 'design/utils/testing'; diff --git a/web/packages/shared/components/ButtonSso/ButtonSso.tsx b/web/packages/shared/components/ButtonSso/ButtonSso.tsx index 9cc4d8c208660..349128a9a1c95 100644 --- a/web/packages/shared/components/ButtonSso/ButtonSso.tsx +++ b/web/packages/shared/components/ButtonSso/ButtonSso.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import React, { forwardRef } from 'react'; +import { forwardRef } from 'react'; import * as Icons from 'design/Icon'; import { ButtonProps, ButtonSecondary } from 'design/Button'; diff --git a/web/packages/shared/components/ButtonTextWithAddIcon/ButtonTextWithAddIcon.story.tsx b/web/packages/shared/components/ButtonTextWithAddIcon/ButtonTextWithAddIcon.story.tsx index 23ffd4ff43a3b..6036e570303b3 100644 --- a/web/packages/shared/components/ButtonTextWithAddIcon/ButtonTextWithAddIcon.story.tsx +++ b/web/packages/shared/components/ButtonTextWithAddIcon/ButtonTextWithAddIcon.story.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import React, { useState } from 'react'; +import { useState } from 'react'; import Flex from 'design/Flex'; import { ButtonTextWithAddIcon } from './ButtonTextWithAddIcon'; diff --git a/web/packages/shared/components/ButtonTextWithAddIcon/ButtonTextWithAddIcon.test.tsx b/web/packages/shared/components/ButtonTextWithAddIcon/ButtonTextWithAddIcon.test.tsx index 6d88f3c1d26b5..06d24ef84b182 100644 --- a/web/packages/shared/components/ButtonTextWithAddIcon/ButtonTextWithAddIcon.test.tsx +++ b/web/packages/shared/components/ButtonTextWithAddIcon/ButtonTextWithAddIcon.test.tsx @@ -16,8 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; - import { render, fireEvent, screen } from 'design/utils/testing'; import { ButtonTextWithAddIcon } from './ButtonTextWithAddIcon'; diff --git a/web/packages/shared/components/ButtonTextWithAddIcon/ButtonTextWithAddIcon.tsx b/web/packages/shared/components/ButtonTextWithAddIcon/ButtonTextWithAddIcon.tsx index d025dbbceacbe..3d65b59944f06 100644 --- a/web/packages/shared/components/ButtonTextWithAddIcon/ButtonTextWithAddIcon.tsx +++ b/web/packages/shared/components/ButtonTextWithAddIcon/ButtonTextWithAddIcon.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import { ButtonText } from 'design'; import { Add as AddIcon } from 'design/Icon'; diff --git a/web/packages/shared/components/ClusterDropdown/ClusterDropdown.story.tsx b/web/packages/shared/components/ClusterDropdown/ClusterDropdown.story.tsx index 1a26d46287c49..b982926874c1d 100644 --- a/web/packages/shared/components/ClusterDropdown/ClusterDropdown.story.tsx +++ b/web/packages/shared/components/ClusterDropdown/ClusterDropdown.story.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import { MemoryRouter } from 'react-router'; import { Cluster } from 'teleport/services/clusters'; diff --git a/web/packages/shared/components/Controls/ViewModeSwitch.tsx b/web/packages/shared/components/Controls/ViewModeSwitch.tsx index 62e5f94b36a3a..2cacc5cdf1d90 100644 --- a/web/packages/shared/components/Controls/ViewModeSwitch.tsx +++ b/web/packages/shared/components/Controls/ViewModeSwitch.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import styled from 'styled-components'; import { Rows, SquaresFour } from 'design/Icon'; diff --git a/web/packages/shared/components/DownloadConnect/DownloadConnect.story.tsx b/web/packages/shared/components/DownloadConnect/DownloadConnect.story.tsx index 9758176f55156..fa206cb57b914 100644 --- a/web/packages/shared/components/DownloadConnect/DownloadConnect.story.tsx +++ b/web/packages/shared/components/DownloadConnect/DownloadConnect.story.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import { Box, Text } from 'design'; import { Platform } from 'design/platform'; diff --git a/web/packages/shared/components/Editor/Tabs.tsx b/web/packages/shared/components/Editor/Tabs.tsx index 80c43c890e7a5..582e973f78c69 100644 --- a/web/packages/shared/components/Editor/Tabs.tsx +++ b/web/packages/shared/components/Editor/Tabs.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import styled from 'styled-components'; import * as Icons from 'design/Icon'; diff --git a/web/packages/shared/components/FieldCheckbox/FieldCheckbox.story.tsx b/web/packages/shared/components/FieldCheckbox/FieldCheckbox.story.tsx index fd646a956a7e2..3c940aeb61a0c 100644 --- a/web/packages/shared/components/FieldCheckbox/FieldCheckbox.story.tsx +++ b/web/packages/shared/components/FieldCheckbox/FieldCheckbox.story.tsx @@ -16,8 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; - import Box from 'design/Box'; import { FieldCheckbox } from '.'; diff --git a/web/packages/shared/components/FieldInput/FieldInput.story.tsx b/web/packages/shared/components/FieldInput/FieldInput.story.tsx index 1cbcef38cc66e..8de1116cf6f31 100644 --- a/web/packages/shared/components/FieldInput/FieldInput.story.tsx +++ b/web/packages/shared/components/FieldInput/FieldInput.story.tsx @@ -16,8 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; - import { ButtonPrimary, Text } from 'design'; import { EmailSolid } from 'design/Icon'; diff --git a/web/packages/shared/components/FieldInput/FieldInput.test.tsx b/web/packages/shared/components/FieldInput/FieldInput.test.tsx index 064ca9f612bf9..2440f5587659a 100644 --- a/web/packages/shared/components/FieldInput/FieldInput.test.tsx +++ b/web/packages/shared/components/FieldInput/FieldInput.test.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import { screen } from '@testing-library/react'; import { render, fireEvent } from 'design/utils/testing'; diff --git a/web/packages/shared/components/FieldMultiInput/FieldMultiInput.story.tsx b/web/packages/shared/components/FieldMultiInput/FieldMultiInput.story.tsx index 2f798d4d923d1..565f1769ace84 100644 --- a/web/packages/shared/components/FieldMultiInput/FieldMultiInput.story.tsx +++ b/web/packages/shared/components/FieldMultiInput/FieldMultiInput.story.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import React, { useState } from 'react'; +import { useState } from 'react'; import Box from 'design/Box'; diff --git a/web/packages/shared/components/FieldMultiInput/FieldMultiInput.test.tsx b/web/packages/shared/components/FieldMultiInput/FieldMultiInput.test.tsx index 89b191e1e5b2d..4d10c34449f26 100644 --- a/web/packages/shared/components/FieldMultiInput/FieldMultiInput.test.tsx +++ b/web/packages/shared/components/FieldMultiInput/FieldMultiInput.test.tsx @@ -17,7 +17,7 @@ */ import userEvent from '@testing-library/user-event'; -import React, { useState } from 'react'; +import { useState } from 'react'; import { act, render, screen } from 'design/utils/testing'; diff --git a/web/packages/shared/components/FieldSelect/FieldSelect.test.tsx b/web/packages/shared/components/FieldSelect/FieldSelect.test.tsx index 08d9a384b05d3..2c3f1cd829fbd 100644 --- a/web/packages/shared/components/FieldSelect/FieldSelect.test.tsx +++ b/web/packages/shared/components/FieldSelect/FieldSelect.test.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import { screen } from '@testing-library/react'; import { render, fireEvent } from 'design/utils/testing'; diff --git a/web/packages/shared/components/FieldSelect/FieldSelectCreatable.test.tsx b/web/packages/shared/components/FieldSelect/FieldSelectCreatable.test.tsx index 13a5ae39089ea..a2f013ad13254 100644 --- a/web/packages/shared/components/FieldSelect/FieldSelectCreatable.test.tsx +++ b/web/packages/shared/components/FieldSelect/FieldSelectCreatable.test.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import { screen } from '@testing-library/react'; import { render } from 'design/utils/testing'; diff --git a/web/packages/shared/components/FieldTextArea/FieldTextArea.story.tsx b/web/packages/shared/components/FieldTextArea/FieldTextArea.story.tsx index bdfc4534ba585..ac63d6eee4373 100644 --- a/web/packages/shared/components/FieldTextArea/FieldTextArea.story.tsx +++ b/web/packages/shared/components/FieldTextArea/FieldTextArea.story.tsx @@ -16,8 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; - import { ButtonPrimary, Text } from 'design'; import Validation from '../../components/Validation'; diff --git a/web/packages/shared/components/FileTransfer/FileTransfer.test.tsx b/web/packages/shared/components/FileTransfer/FileTransfer.test.tsx index 11de431965aad..fbc7caaed47a4 100644 --- a/web/packages/shared/components/FileTransfer/FileTransfer.test.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransfer.test.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import { act, fireEvent, diff --git a/web/packages/shared/components/FileTransfer/FileTransfer.tsx b/web/packages/shared/components/FileTransfer/FileTransfer.tsx index a192461b61447..72d88a8dcc0fc 100644 --- a/web/packages/shared/components/FileTransfer/FileTransfer.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransfer.tsx @@ -16,8 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; - import { useFileTransferContext } from './FileTransferContextProvider'; import { FileTransferDialogDirection, diff --git a/web/packages/shared/components/FileTransfer/FileTransferActionBar.tsx b/web/packages/shared/components/FileTransfer/FileTransferActionBar.tsx index 74c0616f8add0..ccb61201fca83 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferActionBar.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferActionBar.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import { Flex, ButtonIcon, Text } from 'design'; import * as Icons from 'design/Icon'; import { HoverTooltip } from 'design/Tooltip'; diff --git a/web/packages/shared/components/FileTransfer/FileTransferContextProvider.tsx b/web/packages/shared/components/FileTransfer/FileTransferContextProvider.tsx index 031d4bbb0608c..bf804472cc17d 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferContextProvider.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferContextProvider.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import React, { +import { useContext, useState, FC, diff --git a/web/packages/shared/components/FileTransfer/FileTransferRequests.story.tsx b/web/packages/shared/components/FileTransfer/FileTransferRequests.story.tsx index 72c33603237b7..d36e79d7ea9f0 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferRequests.story.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferRequests.story.tsx @@ -16,8 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; - import ConsoleContextProvider from 'teleport/Console/consoleContextProvider'; import ConsoleContext from 'teleport/Console/consoleContext'; import { FileTransferRequest } from 'teleport/Console/DocumentSsh/useFileTransfer'; diff --git a/web/packages/shared/components/FileTransfer/FileTransferRequests.tsx b/web/packages/shared/components/FileTransfer/FileTransferRequests.tsx index 16e864ef7a16b..e526e7c945c44 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferRequests.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferRequests.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import styled from 'styled-components'; import { ButtonBorder, Box, Flex, Text, Button } from 'design'; import * as Icons from 'design/Icon'; diff --git a/web/packages/shared/components/FileTransfer/FileTransferStateless/DownloadForm/DownloadForm.test.tsx b/web/packages/shared/components/FileTransfer/FileTransferStateless/DownloadForm/DownloadForm.test.tsx index be91459bbd712..be88e37eb1c57 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferStateless/DownloadForm/DownloadForm.test.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferStateless/DownloadForm/DownloadForm.test.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import { fireEvent, render, screen } from 'design/utils/testing'; import { DownloadForm } from './DownloadForm'; diff --git a/web/packages/shared/components/FileTransfer/FileTransferStateless/DownloadForm/DownloadForm.tsx b/web/packages/shared/components/FileTransfer/FileTransferStateless/DownloadForm/DownloadForm.tsx index f0b457dbf4447..d428d76f4d09d 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferStateless/DownloadForm/DownloadForm.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferStateless/DownloadForm/DownloadForm.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import React, { useId, useState } from 'react'; +import { useId, useState } from 'react'; import { Flex, LabelInput } from 'design'; import { ButtonPrimary } from 'design/Button'; diff --git a/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileList.test.tsx b/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileList.test.tsx index 9e1c64d6e8b73..ebc4d8fc620cc 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileList.test.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileList.test.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import { fireEvent, render, screen } from 'design/utils/testing'; import { TransferredFile } from '../types'; diff --git a/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileList.tsx b/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileList.tsx index 052e9e100a86e..305be469d9bc4 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileList.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileList.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import styled from 'styled-components'; import { TransferredFile } from '../types'; diff --git a/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileListItem.tsx b/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileListItem.tsx index f55a27612a0bd..9c048535de51a 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileListItem.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileListItem.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import React, { FC, PropsWithChildren, useEffect } from 'react'; +import { FC, PropsWithChildren, useEffect } from 'react'; import styled from 'styled-components'; import { ButtonIcon, Flex, Text } from 'design'; import { CircleCheck, Cross, Warning } from 'design/Icon'; diff --git a/web/packages/shared/components/FileTransfer/FileTransferStateless/FileTransferStateless.story.tsx b/web/packages/shared/components/FileTransfer/FileTransferStateless/FileTransferStateless.story.tsx index c2a212ea68b4d..b7ae036ad3070 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferStateless/FileTransferStateless.story.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferStateless/FileTransferStateless.story.tsx @@ -16,8 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; - import { FileTransferContainer } from '../FileTransferContainer'; import { diff --git a/web/packages/shared/components/FileTransfer/FileTransferStateless/FileTransferStateless.tsx b/web/packages/shared/components/FileTransfer/FileTransferStateless/FileTransferStateless.tsx index a67f6ac03de16..1d9eea8d995f7 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferStateless/FileTransferStateless.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferStateless/FileTransferStateless.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import styled from 'styled-components'; import { ButtonIcon, Flex, Text } from 'design'; import { Cross as CloseIcon } from 'design/Icon'; diff --git a/web/packages/shared/components/FileTransfer/FileTransferStateless/UploadForm/UploadForm.test.tsx b/web/packages/shared/components/FileTransfer/FileTransferStateless/UploadForm/UploadForm.test.tsx index 465387081d940..4493b575717fe 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferStateless/UploadForm/UploadForm.test.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferStateless/UploadForm/UploadForm.test.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import { fireEvent, render, screen } from 'design/utils/testing'; import { UploadForm } from './UploadForm'; diff --git a/web/packages/shared/components/Highlight/Highlight.story.tsx b/web/packages/shared/components/Highlight/Highlight.story.tsx index 946dc1f512ddf..46a1817087d88 100644 --- a/web/packages/shared/components/Highlight/Highlight.story.tsx +++ b/web/packages/shared/components/Highlight/Highlight.story.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import styled from 'styled-components'; import { Flex, Text } from 'design'; diff --git a/web/packages/shared/components/Highlight/Highlight.tsx b/web/packages/shared/components/Highlight/Highlight.tsx index 017c1903729c4..c1a3c73767471 100644 --- a/web/packages/shared/components/Highlight/Highlight.tsx +++ b/web/packages/shared/components/Highlight/Highlight.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import { findAll } from 'highlight-words-core'; /** diff --git a/web/packages/shared/components/MenuAction/MenuAction.story.tsx b/web/packages/shared/components/MenuAction/MenuAction.story.tsx index 156193ea6aeac..4b5bbc4a5ed1e 100644 --- a/web/packages/shared/components/MenuAction/MenuAction.story.tsx +++ b/web/packages/shared/components/MenuAction/MenuAction.story.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import { Flex } from 'design'; import { Cog } from 'design/Icon'; diff --git a/web/packages/shared/components/MenuAction/MenuAction.test.tsx b/web/packages/shared/components/MenuAction/MenuAction.test.tsx index 184bb434e495a..e376c2ecf98dc 100644 --- a/web/packages/shared/components/MenuAction/MenuAction.test.tsx +++ b/web/packages/shared/components/MenuAction/MenuAction.test.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import { screen } from '@testing-library/react'; import { render, fireEvent } from 'design/utils/testing'; diff --git a/web/packages/shared/components/MenuLogin/MenuLogin.test.tsx b/web/packages/shared/components/MenuLogin/MenuLogin.test.tsx index 585fc04b8b54e..fec647363bb23 100644 --- a/web/packages/shared/components/MenuLogin/MenuLogin.test.tsx +++ b/web/packages/shared/components/MenuLogin/MenuLogin.test.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import { render, fireEvent, screen, waitFor } from 'design/utils/testing'; import { MenuLogin } from './MenuLogin'; diff --git a/web/packages/shared/components/Notification/Notification.story.tsx b/web/packages/shared/components/Notification/Notification.story.tsx index 4df7b2e7ee299..b3b2b1b9fe5ad 100644 --- a/web/packages/shared/components/Notification/Notification.story.tsx +++ b/web/packages/shared/components/Notification/Notification.story.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import React, { useState } from 'react'; +import { useState } from 'react'; import { Bots } from 'design/Icon'; import Flex from 'design/Flex'; diff --git a/web/packages/shared/components/Search/SearchPagination.tsx b/web/packages/shared/components/Search/SearchPagination.tsx index d4d31851abf7d..f2cdbe89ec7e6 100644 --- a/web/packages/shared/components/Search/SearchPagination.tsx +++ b/web/packages/shared/components/Search/SearchPagination.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import { Flex } from 'design'; import { StyledPanel } from 'design/DataTable/StyledTable'; import { StyledArrowBtn } from 'design/DataTable/Pager/StyledPager'; diff --git a/web/packages/shared/components/Search/SearchPanel.tsx b/web/packages/shared/components/Search/SearchPanel.tsx index e4dec55a30776..4c470b6b790b9 100644 --- a/web/packages/shared/components/Search/SearchPanel.tsx +++ b/web/packages/shared/components/Search/SearchPanel.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import React, { useEffect, useState } from 'react'; +import { useEffect, useState } from 'react'; import styled from 'styled-components'; import { Flex } from 'design'; import InputSearch from 'design/DataTable/InputSearch'; diff --git a/web/packages/shared/components/Select/Select.tsx b/web/packages/shared/components/Select/Select.tsx index 2f86a5d87a0cf..1beaab055b905 100644 --- a/web/packages/shared/components/Select/Select.tsx +++ b/web/packages/shared/components/Select/Select.tsx @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import React from 'react'; import ReactSelect, { ClearIndicatorProps, DropdownIndicatorProps, diff --git a/web/packages/shared/components/Select/SelectCreatable.story.tsx b/web/packages/shared/components/Select/SelectCreatable.story.tsx index 02bfcba2cc647..e813e6f4496cd 100644 --- a/web/packages/shared/components/Select/SelectCreatable.story.tsx +++ b/web/packages/shared/components/Select/SelectCreatable.story.tsx @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -import React from 'react'; +import { useState } from 'react'; import { Flex, Box } from 'design'; import { SelectCreatable, Option } from '../Select'; @@ -26,10 +26,10 @@ export default { }; export const Selects = () => { - const [input, setInput] = React.useState(''); - const [inputMulti, setInputMulti] = React.useState(''); - const [selected, setSelected] = React.useState