diff --git a/apps/meteor/client/views/directory/DirectoryPage.tsx b/apps/meteor/client/views/directory/DirectoryPage.tsx index da056be8acdb9..8965d343ba9aa 100644 --- a/apps/meteor/client/views/directory/DirectoryPage.tsx +++ b/apps/meteor/client/views/directory/DirectoryPage.tsx @@ -1,7 +1,6 @@ import { Tabs } from '@rocket.chat/fuselage'; import { Page, PageHeader, PageContent } from '@rocket.chat/ui-client'; import { useRouter, useRouteParameter, useSetting } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; import { useEffect, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; @@ -11,7 +10,7 @@ import UsersTab from './tabs/users/UsersTab'; type TabName = 'users' | 'channels' | 'teams' | 'external'; -const DirectoryPage = (): ReactElement => { +const DirectoryPage = () => { const { t } = useTranslation(); const defaultTab = useSetting('Accounts_Directory_DefaultView', 'users'); diff --git a/apps/meteor/client/views/directory/tabs/channels/ChannelsTab.tsx b/apps/meteor/client/views/directory/tabs/channels/ChannelsTab.tsx index 4d4b813022d70..40cbd9188f9ac 100644 --- a/apps/meteor/client/views/directory/tabs/channels/ChannelsTab.tsx +++ b/apps/meteor/client/views/directory/tabs/channels/ChannelsTab.tsx @@ -1,10 +1,9 @@ import { usePermission } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; import ChannelsTable from './ChannelsTable'; import NotAuthorizedPage from '../../../notAuthorized/NotAuthorizedPage'; -const ChannelsTab = (): ReactElement => { +const ChannelsTab = () => { const canViewPublicRooms = usePermission('view-c-room'); if (canViewPublicRooms) { diff --git a/apps/meteor/client/views/directory/tabs/teams/TeamsTab.tsx b/apps/meteor/client/views/directory/tabs/teams/TeamsTab.tsx index e5a44d7d7c37a..69301113c67e9 100644 --- a/apps/meteor/client/views/directory/tabs/teams/TeamsTab.tsx +++ b/apps/meteor/client/views/directory/tabs/teams/TeamsTab.tsx @@ -1,10 +1,9 @@ import { usePermission } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; import TeamsTable from './TeamsTable'; import NotAuthorizedPage from '../../../notAuthorized/NotAuthorizedPage'; -const TeamsTab = (): ReactElement => { +const TeamsTab = () => { const canViewPublicRooms = usePermission('view-c-room'); if (canViewPublicRooms) { diff --git a/apps/meteor/client/views/directory/tabs/users/UsersTab.tsx b/apps/meteor/client/views/directory/tabs/users/UsersTab.tsx index e7d8ff56a00eb..e1fd8f6063236 100644 --- a/apps/meteor/client/views/directory/tabs/users/UsersTab.tsx +++ b/apps/meteor/client/views/directory/tabs/users/UsersTab.tsx @@ -1,10 +1,13 @@ import { usePermission } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; import UsersTable from './UsersTable'; import NotAuthorizedPage from '../../../notAuthorized/NotAuthorizedPage'; -const UsersTab = (props: { workspace?: 'external' | 'local' }): ReactElement => { +type UsersTabProps = { + workspace?: 'external' | 'local'; +}; + +const UsersTab = (props: UsersTabProps) => { const canViewOutsideRoom = usePermission('view-outside-room'); const canViewDM = usePermission('view-d-room'); diff --git a/apps/meteor/client/views/directory/tabs/users/UsersTable/UsersTable.tsx b/apps/meteor/client/views/directory/tabs/users/UsersTable/UsersTable.tsx index ad907dc922603..cf11463be9843 100644 --- a/apps/meteor/client/views/directory/tabs/users/UsersTable/UsersTable.tsx +++ b/apps/meteor/client/views/directory/tabs/users/UsersTable/UsersTable.tsx @@ -12,7 +12,7 @@ import { } from '@rocket.chat/ui-client'; import { usePermission, useRoute, useTranslation, useEndpoint } from '@rocket.chat/ui-contexts'; import { useQuery } from '@tanstack/react-query'; -import type { KeyboardEvent, MouseEvent, ReactElement } from 'react'; +import type { KeyboardEvent, MouseEvent } from 'react'; import { useCallback, useMemo, useState } from 'react'; import UsersTableRow from './UsersTableRow'; @@ -20,7 +20,11 @@ import FilterByText from '../../../../../components/FilterByText'; import GenericNoResults from '../../../../../components/GenericNoResults'; import { useDirectoryQuery } from '../../../hooks/useDirectoryQuery'; -const UsersTable = ({ workspace = 'local' }): ReactElement => { +type UsersTableProps = { + workspace?: 'external' | 'local'; +}; + +const UsersTable = ({ workspace = 'local' }: UsersTableProps) => { const t = useTranslation(); const mediaQuery = useMediaQuery('(min-width: 1024px)'); diff --git a/apps/meteor/client/views/e2e/SaveE2EPasswordModal.tsx b/apps/meteor/client/views/e2e/SaveE2EPasswordModal.tsx index 1e8f21692fda2..19d17dfca3d89 100644 --- a/apps/meteor/client/views/e2e/SaveE2EPasswordModal.tsx +++ b/apps/meteor/client/views/e2e/SaveE2EPasswordModal.tsx @@ -1,7 +1,7 @@ import { Box, CodeSnippet } from '@rocket.chat/fuselage'; import { useClipboard } from '@rocket.chat/fuselage-hooks'; import { ExternalLink, GenericModal } from '@rocket.chat/ui-client'; -import { useId, type ReactElement } from 'react'; +import { useId } from 'react'; import { useTranslation } from 'react-i18next'; import { links } from '../../lib/links'; @@ -15,7 +15,7 @@ type SaveE2EPasswordModalProps = { const DOCS_URL = links.go.e2eeGuide; -const SaveE2EPasswordModal = ({ randomPassword, onClose, onCancel, onConfirm }: SaveE2EPasswordModalProps): ReactElement => { +const SaveE2EPasswordModal = ({ randomPassword, onClose, onCancel, onConfirm }: SaveE2EPasswordModalProps) => { const { t } = useTranslation(); const { copy, hasCopied } = useClipboard(randomPassword); const passwordId = useId(); diff --git a/apps/meteor/client/views/home/CustomHomePage.tsx b/apps/meteor/client/views/home/CustomHomePage.tsx index ceffc41c95045..d36cbac76f098 100644 --- a/apps/meteor/client/views/home/CustomHomePage.tsx +++ b/apps/meteor/client/views/home/CustomHomePage.tsx @@ -1,10 +1,9 @@ import { Page, PageScrollableContentWithShadow } from '@rocket.chat/ui-client'; -import type { ReactElement } from 'react'; import HomePageHeader from './HomePageHeader'; import CustomContentCard from './cards/CustomContentCard'; -const CustomHomePage = (): ReactElement => { +const CustomHomePage = () => { return ( diff --git a/apps/meteor/client/views/home/CustomHomePageContent.tsx b/apps/meteor/client/views/home/CustomHomePageContent.tsx index 8fb7bffac975d..5c266ea0d72fa 100644 --- a/apps/meteor/client/views/home/CustomHomePageContent.tsx +++ b/apps/meteor/client/views/home/CustomHomePageContent.tsx @@ -1,8 +1,8 @@ import { Box } from '@rocket.chat/fuselage'; import { useSetting } from '@rocket.chat/ui-contexts'; -import type { ComponentProps, ReactElement } from 'react'; +import type { ComponentProps } from 'react'; -const CustomHomePageContent = (props: ComponentProps): ReactElement => { +const CustomHomePageContent = (props: ComponentProps) => { const body = useSetting('Layout_Home_Body', ''); return ; diff --git a/apps/meteor/client/views/home/DefaultHomePage.tsx b/apps/meteor/client/views/home/DefaultHomePage.tsx index fa394949c4f4b..94047e6fba889 100644 --- a/apps/meteor/client/views/home/DefaultHomePage.tsx +++ b/apps/meteor/client/views/home/DefaultHomePage.tsx @@ -1,7 +1,6 @@ import { Box, CardGroup } from '@rocket.chat/fuselage'; import { PageScrollableContent, Page } from '@rocket.chat/ui-client'; import { useAtLeastOnePermission, useSetting, useTranslation, useRole, usePermission } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; import HomePageHeader from './HomePageHeader'; import AddUsersCard from './cards/AddUsersCard'; @@ -14,7 +13,7 @@ import MobileAppsCard from './cards/MobileAppsCard'; const CREATE_CHANNEL_PERMISSIONS = ['create-c', 'create-p']; -const DefaultHomePage = (): ReactElement => { +const DefaultHomePage = () => { const t = useTranslation(); const canAddUsers = usePermission('view-user-administration'); const isAdmin = useRole('admin'); diff --git a/apps/meteor/client/views/home/HomePage.tsx b/apps/meteor/client/views/home/HomePage.tsx index 1cc4654eeea12..786f0f1686267 100644 --- a/apps/meteor/client/views/home/HomePage.tsx +++ b/apps/meteor/client/views/home/HomePage.tsx @@ -1,10 +1,9 @@ import { useSetting } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; import CustomHomePage from './CustomHomePage'; import DefaultHomePage from './DefaultHomePage'; -const HomePage = (): ReactElement => { +const HomePage = () => { const customOnly = useSetting('Layout_Custom_Body_Only'); if (customOnly) { diff --git a/apps/meteor/client/views/home/HomePageHeader.tsx b/apps/meteor/client/views/home/HomePageHeader.tsx index 85018f42ee805..f0c2492a9290e 100644 --- a/apps/meteor/client/views/home/HomePageHeader.tsx +++ b/apps/meteor/client/views/home/HomePageHeader.tsx @@ -1,11 +1,10 @@ import { Button } from '@rocket.chat/fuselage'; import { PageHeader } from '@rocket.chat/ui-client'; import { useSetting, useTranslation, useAllPermissions, useRoute } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; const EDIT_LAYOUT_PERMISSIONS = ['view-privileged-setting', 'edit-privileged-setting', 'manage-selected-settings']; -const HomepageHeader = (): ReactElement => { +const HomepageHeader = () => { const t = useTranslation(); const title = useSetting('Layout_Home_Title', 'Home'); const canEditLayout = useAllPermissions(EDIT_LAYOUT_PERMISSIONS); diff --git a/apps/meteor/client/views/home/HomepageGridItem.tsx b/apps/meteor/client/views/home/HomepageGridItem.tsx index c7f255d2bcba2..1ba028e9f405f 100644 --- a/apps/meteor/client/views/home/HomepageGridItem.tsx +++ b/apps/meteor/client/views/home/HomepageGridItem.tsx @@ -1,8 +1,8 @@ import { GridItem } from '@rocket.chat/fuselage'; import { useBreakpoints } from '@rocket.chat/fuselage-hooks'; -import type { ReactNode, ReactElement } from 'react'; +import type { ReactNode } from 'react'; -const HomepageGridItem = ({ children }: { children: ReactNode }): ReactElement => { +const HomepageGridItem = ({ children }: { children: ReactNode }) => { const breakpoints = useBreakpoints(); const isMedium = !breakpoints.includes('lg'); diff --git a/apps/meteor/client/views/home/cards/AddUsersCard.tsx b/apps/meteor/client/views/home/cards/AddUsersCard.tsx index dea1090f786b7..d6f0cce8a036b 100644 --- a/apps/meteor/client/views/home/cards/AddUsersCard.tsx +++ b/apps/meteor/client/views/home/cards/AddUsersCard.tsx @@ -1,10 +1,10 @@ import type { Card } from '@rocket.chat/fuselage'; import { useTranslation, useRouter } from '@rocket.chat/ui-contexts'; -import type { ComponentProps, ReactElement } from 'react'; +import type { ComponentProps } from 'react'; import { GenericCard, GenericCardButton } from '../../../components/GenericCard'; -const AddUsersCard = (props: Omit, 'type'>): ReactElement => { +const AddUsersCard = (props: Omit, 'type'>) => { const t = useTranslation(); const router = useRouter(); diff --git a/apps/meteor/client/views/home/cards/CreateChannelsCard.tsx b/apps/meteor/client/views/home/cards/CreateChannelsCard.tsx index 8083f005aa3c7..e37df36494e61 100644 --- a/apps/meteor/client/views/home/cards/CreateChannelsCard.tsx +++ b/apps/meteor/client/views/home/cards/CreateChannelsCard.tsx @@ -1,11 +1,11 @@ import type { Card } from '@rocket.chat/fuselage'; import { useTranslation, useSetModal } from '@rocket.chat/ui-contexts'; -import type { ComponentProps, ReactElement } from 'react'; +import type { ComponentProps } from 'react'; import { GenericCard, GenericCardButton } from '../../../components/GenericCard'; import CreateChannelModal from '../../../navbar/NavBarPagesGroup/actions/CreateChannelModal'; -const CreateChannelsCard = (props: Omit, 'type'>): ReactElement => { +const CreateChannelsCard = (props: Omit, 'type'>) => { const t = useTranslation(); const setModal = useSetModal(); diff --git a/apps/meteor/client/views/home/cards/CustomContentCard.tsx b/apps/meteor/client/views/home/cards/CustomContentCard.tsx index 77a8d64192fff..c90280802c418 100644 --- a/apps/meteor/client/views/home/cards/CustomContentCard.tsx +++ b/apps/meteor/client/views/home/cards/CustomContentCard.tsx @@ -1,12 +1,12 @@ import { Box, Button, Card, CardBody, CardControls, CardHeader, Icon, Tag } from '@rocket.chat/fuselage'; import { useRole, useSettingSetValue, useSetting, useToastMessageDispatch, useRouter } from '@rocket.chat/ui-contexts'; -import type { ComponentProps, ReactElement } from 'react'; +import type { ComponentProps } from 'react'; import { useTranslation } from 'react-i18next'; import { useIsEnterprise } from '../../../hooks/useIsEnterprise'; import CustomHomepageContent from '../CustomHomePageContent'; -const CustomContentCard = (props: Omit, 'type'>): ReactElement | null => { +const CustomContentCard = (props: Omit, 'type'>) => { const { t } = useTranslation(); const dispatchToastMessage = useToastMessageDispatch(); const router = useRouter(); diff --git a/apps/meteor/client/views/home/cards/DesktopAppsCard.tsx b/apps/meteor/client/views/home/cards/DesktopAppsCard.tsx index d4165f0f746b9..4c4cc3192cf9a 100644 --- a/apps/meteor/client/views/home/cards/DesktopAppsCard.tsx +++ b/apps/meteor/client/views/home/cards/DesktopAppsCard.tsx @@ -1,5 +1,5 @@ import type { Card } from '@rocket.chat/fuselage'; -import type { ComponentProps, ReactElement } from 'react'; +import type { ComponentProps } from 'react'; import { useTranslation } from 'react-i18next'; import { GenericCard, GenericCardButton } from '../../../components/GenericCard'; @@ -10,7 +10,7 @@ const WINDOWS_APP_URL = links.go.desktopAppWindows; const LINUX_APP_URL = links.go.desktopAppLinux; const MAC_APP_URL = links.go.desktopAppMac; -const DesktopAppsCard = (props: Omit, 'type'>): ReactElement => { +const DesktopAppsCard = (props: Omit, 'type'>) => { const { t } = useTranslation(); const handleOpenLink = useExternalLink(); diff --git a/apps/meteor/client/views/home/cards/DocumentationCard.tsx b/apps/meteor/client/views/home/cards/DocumentationCard.tsx index 7854b4dfc718b..eb00fd5197af3 100644 --- a/apps/meteor/client/views/home/cards/DocumentationCard.tsx +++ b/apps/meteor/client/views/home/cards/DocumentationCard.tsx @@ -1,5 +1,5 @@ import type { Card } from '@rocket.chat/fuselage'; -import type { ComponentProps, ReactElement } from 'react'; +import type { ComponentProps } from 'react'; import { useTranslation } from 'react-i18next'; import { GenericCard, GenericCardButton } from '../../../components/GenericCard'; @@ -8,7 +8,7 @@ import { links } from '../../../lib/links'; const DOCS_URL = links.go.documentation; -const DocumentationCard = (props: Omit, 'type'>): ReactElement => { +const DocumentationCard = (props: Omit, 'type'>) => { const { t } = useTranslation(); const handleOpenLink = useExternalLink(); diff --git a/apps/meteor/client/views/home/cards/JoinRoomsCard.tsx b/apps/meteor/client/views/home/cards/JoinRoomsCard.tsx index f0ff5b45de9d5..ba305478cdea6 100644 --- a/apps/meteor/client/views/home/cards/JoinRoomsCard.tsx +++ b/apps/meteor/client/views/home/cards/JoinRoomsCard.tsx @@ -1,10 +1,10 @@ import type { Card } from '@rocket.chat/fuselage'; import { useTranslation, useRouter } from '@rocket.chat/ui-contexts'; -import type { ComponentProps, ReactElement } from 'react'; +import type { ComponentProps } from 'react'; import { GenericCard, GenericCardButton } from '../../../components/GenericCard'; -const JoinRoomsCard = (props: Omit, 'type'>): ReactElement => { +const JoinRoomsCard = (props: Omit, 'type'>) => { const t = useTranslation(); const router = useRouter(); diff --git a/apps/meteor/client/views/home/cards/MobileAppsCard.tsx b/apps/meteor/client/views/home/cards/MobileAppsCard.tsx index bc88d2bc8d43e..d8ca729afb20e 100644 --- a/apps/meteor/client/views/home/cards/MobileAppsCard.tsx +++ b/apps/meteor/client/views/home/cards/MobileAppsCard.tsx @@ -1,5 +1,5 @@ import type { Card } from '@rocket.chat/fuselage'; -import type { ComponentProps, ReactElement } from 'react'; +import type { ComponentProps } from 'react'; import { useTranslation } from 'react-i18next'; import { GenericCard, GenericCardButton } from '../../../components/GenericCard'; @@ -9,7 +9,7 @@ import { links } from '../../../lib/links'; const GOOGLE_PLAY_URL = links.go.mobileAppGoogle; const APP_STORE_URL = links.go.mobileAppApple; -const MobileAppsCard = (props: Omit, 'type'>): ReactElement => { +const MobileAppsCard = (props: Omit, 'type'>) => { const { t } = useTranslation(); const handleOpenLink = useExternalLink(); diff --git a/apps/meteor/client/views/invite/InvitePage.tsx b/apps/meteor/client/views/invite/InvitePage.tsx index 77c5708b6d5bc..5aeea04b93b70 100644 --- a/apps/meteor/client/views/invite/InvitePage.tsx +++ b/apps/meteor/client/views/invite/InvitePage.tsx @@ -1,6 +1,5 @@ import { HeroLayout, HeroLayoutTitle } from '@rocket.chat/layout'; import { useRouteParameter, useUserId } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; import { useEffect, useRef } from 'react'; import { useTranslation } from 'react-i18next'; @@ -10,7 +9,7 @@ import { useInviteTokenMutation } from './hooks/useInviteTokenMutation'; import { useSamlInviteToken } from './hooks/useSamlInviteToken'; import { useValidateInviteQuery } from './hooks/useValidateInviteQuery'; -const InvitePage = (): ReactElement => { +const InvitePage = () => { const { t } = useTranslation(); const token = useRouteParameter('hash'); diff --git a/apps/meteor/client/views/invite/SecretURLPage.tsx b/apps/meteor/client/views/invite/SecretURLPage.tsx index 7d4324e35fb6a..4759987f1b604 100644 --- a/apps/meteor/client/views/invite/SecretURLPage.tsx +++ b/apps/meteor/client/views/invite/SecretURLPage.tsx @@ -1,9 +1,8 @@ import { useUserId, useRouter } from '@rocket.chat/ui-contexts'; import RegistrationPageRouter from '@rocket.chat/web-ui-registration'; -import type { ReactElement } from 'react'; import { useEffect } from 'react'; -const SecretURLPage = (): ReactElement | null => { +const SecretURLPage = () => { const uid = useUserId(); const router = useRouter(); diff --git a/apps/meteor/client/views/marketplace/AppDetailsPage/AppDetailsPage.tsx b/apps/meteor/client/views/marketplace/AppDetailsPage/AppDetailsPage.tsx index eed2e5003868d..f19cba712cec0 100644 --- a/apps/meteor/client/views/marketplace/AppDetailsPage/AppDetailsPage.tsx +++ b/apps/meteor/client/views/marketplace/AppDetailsPage/AppDetailsPage.tsx @@ -1,10 +1,8 @@ -import type { ISetting } from '@rocket.chat/apps-engine/definition/settings'; import type { App, SettingValue } from '@rocket.chat/core-typings'; import { Button, ButtonGroup, Box } from '@rocket.chat/fuselage'; import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; import { Page, PageFooter, PageHeader, PageScrollableContentWithShadow } from '@rocket.chat/ui-client'; import { useTranslation, useRouteParameter, useToastMessageDispatch, usePermission, useRouter } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; import { useMemo, useCallback } from 'react'; import { FormProvider, useForm } from 'react-hook-form'; @@ -31,7 +29,7 @@ type AppDetailsPageProps = { id: App['id']; }; -const AppDetailsPage = ({ id }: AppDetailsPageProps): ReactElement => { +const AppDetailsPage = ({ id }: AppDetailsPageProps) => { const t = useTranslation(); const router = useRouter(); const dispatchToastMessage = useToastMessageDispatch(); @@ -92,7 +90,7 @@ const AppDetailsPage = ({ id }: AppDetailsPageProps): ReactElement => { try { await AppClientOrchestratorInstance.setAppSettings( id, - (Object.values(settings || {}) as ISetting[]).map((setting) => ({ + Object.values(settings || {}).map((setting) => ({ ...setting, value: data[setting.id], })), diff --git a/apps/meteor/client/views/marketplace/AppDetailsPage/AppDetailsPageHeader.tsx b/apps/meteor/client/views/marketplace/AppDetailsPage/AppDetailsPageHeader.tsx index e725eb15d4c4c..0ceaf3af50cdd 100644 --- a/apps/meteor/client/views/marketplace/AppDetailsPage/AppDetailsPageHeader.tsx +++ b/apps/meteor/client/views/marketplace/AppDetailsPage/AppDetailsPageHeader.tsx @@ -2,7 +2,6 @@ import type { App } from '@rocket.chat/core-typings'; import { Box, Tag } from '@rocket.chat/fuselage'; import { AppAvatar } from '@rocket.chat/ui-avatar'; import { formatDistanceToNow } from 'date-fns'; -import type { ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; import AppMenu from '../AppMenu'; @@ -16,7 +15,7 @@ const versioni18nKey = (app: App): string => { return installed ? version : marketplaceVersion; }; -const AppDetailsPageHeader = ({ app }: { app: App }): ReactElement => { +const AppDetailsPageHeader = ({ app }: { app: App }) => { const { t } = useTranslation(); const { iconFileData, diff --git a/apps/meteor/client/views/marketplace/AppDetailsPage/AppDetailsPageTabs.tsx b/apps/meteor/client/views/marketplace/AppDetailsPage/AppDetailsPageTabs.tsx index 6b752a3d757fa..f3afca4a8eb70 100644 --- a/apps/meteor/client/views/marketplace/AppDetailsPage/AppDetailsPageTabs.tsx +++ b/apps/meteor/client/views/marketplace/AppDetailsPage/AppDetailsPageTabs.tsx @@ -1,6 +1,5 @@ import { Tabs } from '@rocket.chat/fuselage'; import { usePermission, useRouter } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; import type { ISettings } from '../../../apps/@types/IOrchestrator'; @@ -21,7 +20,7 @@ const AppDetailsPageTabs = ({ settings, tab, hasCluster = false, -}: AppDetailsPageTabsProps): ReactElement => { +}: AppDetailsPageTabsProps) => { const { t } = useTranslation(); const isAdminUser = usePermission('manage-apps'); diff --git a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppInstances/AppInstances.tsx b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppInstances/AppInstances.tsx index ac2ca5a37dea9..2d75cb487c1ab 100644 --- a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppInstances/AppInstances.tsx +++ b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppInstances/AppInstances.tsx @@ -12,7 +12,6 @@ import { GenericTableRow, } from '@rocket.chat/ui-client'; import { useRouter } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; import GenericNoResults from '../../../../../components/GenericNoResults'; @@ -23,7 +22,7 @@ type AppInstanceProps = { id: string; }; -const AppInstances = ({ id }: AppInstanceProps): ReactElement => { +const AppInstances = ({ id }: AppInstanceProps) => { const { t } = useTranslation(); const { data, isSuccess, isError, isLoading } = useAppInstances({ appId: id }); diff --git a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppLogs/AppLogs.tsx b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppLogs/AppLogs.tsx index 2a051cf6f2044..c4c57e73e04a2 100644 --- a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppLogs/AppLogs.tsx +++ b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppLogs/AppLogs.tsx @@ -2,7 +2,7 @@ import type { ILogItem } from '@rocket.chat/core-typings'; import { Box, Pagination } from '@rocket.chat/fuselage'; import { CustomScrollbars, usePagination } from '@rocket.chat/ui-client'; import { useRouter } from '@rocket.chat/ui-contexts'; -import { useEffect, useMemo, useReducer, type ReactElement } from 'react'; +import { useEffect, useMemo, useReducer } from 'react'; import { useTranslation } from 'react-i18next'; import AppLogsItem from './AppLogsItem'; @@ -40,7 +40,7 @@ function expandedReducer( } } -const AppLogs = ({ id }: { id: string }): ReactElement => { +const AppLogs = ({ id }: { id: string }) => { const { t } = useTranslation(); const router = useRouter(); diff --git a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppReleases/AppReleases.tsx b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppReleases/AppReleases.tsx index 9ddbf5a7237f4..ee01ab2c15992 100644 --- a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppReleases/AppReleases.tsx +++ b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppReleases/AppReleases.tsx @@ -2,13 +2,12 @@ import type { App } from '@rocket.chat/core-typings'; import { Accordion } from '@rocket.chat/fuselage'; import { useEndpoint } from '@rocket.chat/ui-contexts'; import { useQuery } from '@tanstack/react-query'; -import type { ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; import AppReleasesItem from './AppReleasesItem'; import AccordionLoading from '../../../components/AccordionLoading'; -const AppReleases = ({ id }: { id: App['id'] }): ReactElement => { +const AppReleases = ({ id }: { id: App['id'] }) => { const getVersions = useEndpoint('GET', '/apps/:id/versions', { id }); const { t } = useTranslation(); diff --git a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppReleases/AppReleasesItem.tsx b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppReleases/AppReleasesItem.tsx index 5f86087c18f79..4be6142bb2325 100644 --- a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppReleases/AppReleasesItem.tsx +++ b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppReleases/AppReleasesItem.tsx @@ -1,6 +1,5 @@ import { AccordionItem, Box } from '@rocket.chat/fuselage'; import DOMPurify from 'dompurify'; -import type { ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; import { useTimeAgo } from '../../../../../hooks/useTimeAgo'; @@ -19,7 +18,7 @@ type ReleaseItemProps = { release: IRelease; }; -const AppReleasesItem = ({ release, ...props }: ReleaseItemProps): ReactElement => { +const AppReleasesItem = ({ release, ...props }: ReleaseItemProps) => { const { t } = useTranslation(); const formatDate = useTimeAgo(); diff --git a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppRequests/AppRequestItem.tsx b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppRequests/AppRequestItem.tsx index 09f1267e347a5..70cb035990d1a 100644 --- a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppRequests/AppRequestItem.tsx +++ b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppRequests/AppRequestItem.tsx @@ -1,7 +1,6 @@ import { Badge, Box } from '@rocket.chat/fuselage'; import { UserAvatar } from '@rocket.chat/ui-avatar'; import { usePermission } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; import { useFormatDateAndTime } from '../../../../../hooks/useFormatDateAndTime'; @@ -13,7 +12,7 @@ type AppRequestItemProps = { username: string; }; -const AppRequestItem = ({ seen, name, createdDate, message, username }: AppRequestItemProps): ReactElement => { +const AppRequestItem = ({ seen, name, createdDate, message, username }: AppRequestItemProps) => { const formatDateAndTime = useFormatDateAndTime(); const isAdminUser = usePermission('manage-apps'); diff --git a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppRequests/AppRequests.tsx b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppRequests/AppRequests.tsx index 4a1335a7392b6..d4deae46c0f6d 100644 --- a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppRequests/AppRequests.tsx +++ b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppRequests/AppRequests.tsx @@ -2,7 +2,7 @@ import type { App } from '@rocket.chat/core-typings'; import { Box, Pagination, States, StatesSubtitle, StatesTitle } from '@rocket.chat/fuselage'; import { useEndpoint } from '@rocket.chat/ui-contexts'; import { useMutation, useQueryClient } from '@tanstack/react-query'; -import type { ReactElement, SetStateAction } from 'react'; +import type { SetStateAction } from 'react'; import { useState, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; @@ -13,7 +13,7 @@ import { useAppsReload } from '../../../hooks/useAppsReload'; type itemsPerPage = 25 | 50 | 100; -const AppRequests = ({ id, isAdminUser }: { id: App['id']; isAdminUser: boolean }): ReactElement => { +const AppRequests = ({ id, isAdminUser }: { id: App['id']; isAdminUser: boolean }) => { const [limit, setLimit] = useState(25); const [offset, setOffset] = useState(0); diff --git a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppRequests/AppRequestsLoading.tsx b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppRequests/AppRequestsLoading.tsx index 97bf68a36e2c2..4c14d5b596dc8 100644 --- a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppRequests/AppRequestsLoading.tsx +++ b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppRequests/AppRequestsLoading.tsx @@ -1,7 +1,6 @@ import { Box, Skeleton } from '@rocket.chat/fuselage'; -import type { ReactElement } from 'react'; -const AppRequestsLoading = (): ReactElement => { +const AppRequestsLoading = () => { const appRequestsLoading = Array.from({ length: 5 }, (_, i) => ( diff --git a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppSecurity/AppSecurity.tsx b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppSecurity/AppSecurity.tsx index 869892a69b03b..99e9df2d379d7 100644 --- a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppSecurity/AppSecurity.tsx +++ b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppSecurity/AppSecurity.tsx @@ -1,6 +1,5 @@ import type { AppPermission } from '@rocket.chat/core-typings'; import { Box, Margins } from '@rocket.chat/fuselage'; -import type { ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; import AppSecurityLabel from './AppSecurityLabel'; @@ -13,7 +12,7 @@ type AppSecurityProps = { privacyLink?: string; }; -const AppSecurity = ({ privacyPolicySummary, appPermissions, tosLink, privacyLink }: AppSecurityProps): ReactElement => { +const AppSecurity = ({ privacyPolicySummary, appPermissions, tosLink, privacyLink }: AppSecurityProps) => { const { t } = useTranslation(); return ( diff --git a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppSecurity/AppSecurityLabel.tsx b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppSecurity/AppSecurityLabel.tsx index 24473a470cf2f..162257ac290fb 100644 --- a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppSecurity/AppSecurityLabel.tsx +++ b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppSecurity/AppSecurityLabel.tsx @@ -1,7 +1,6 @@ import { Box } from '@rocket.chat/fuselage'; -import type { ReactElement } from 'react'; -const AppSecurityLabel = ({ children }: { children: string }): ReactElement => ( +const AppSecurityLabel = ({ children }: { children: string }) => ( {children} diff --git a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppSettings/AppSetting.tsx b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppSettings/AppSetting.tsx index 07d375186c37c..75c02c55352d0 100644 --- a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppSettings/AppSetting.tsx +++ b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppSettings/AppSetting.tsx @@ -1,7 +1,6 @@ import type { ISettingSelectValue } from '@rocket.chat/apps-engine/definition/settings'; import type { ISetting } from '@rocket.chat/apps-engine/definition/settings/ISetting'; import { useRouteParameter } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; import { useMemo } from 'react'; import { Controller, useFormContext } from 'react-hook-form'; @@ -9,7 +8,7 @@ import MarkdownText from '../../../../../components/MarkdownText'; import MemoizedSetting from '../../../../admin/settings/Setting/MemoizedSetting'; import { useAppTranslation } from '../../../hooks/useAppTranslation'; -const AppSetting = ({ id, type, i18nLabel, i18nDescription, values, value, packageValue, ...props }: ISetting): ReactElement => { +const AppSetting = ({ id, type, i18nLabel, i18nDescription, values, value, packageValue, ...props }: ISetting) => { const appId = useRouteParameter('id'); const tApp = useAppTranslation(appId || ''); diff --git a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppStatus/AppStatus.tsx b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppStatus/AppStatus.tsx index 998a865457c0c..1d92b28d3624c 100644 --- a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppStatus/AppStatus.tsx +++ b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppStatus/AppStatus.tsx @@ -2,7 +2,6 @@ import type { App } from '@rocket.chat/core-typings'; import { Box, Button, Tag, Margins, Icon } from '@rocket.chat/fuselage'; import { useSafely } from '@rocket.chat/fuselage-hooks'; import { useRouteParameter, usePermission, useSetModal } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; import { useCallback, useState, memo } from 'react'; import { useTranslation } from 'react-i18next'; import semver from 'semver'; @@ -24,7 +23,7 @@ type AppStatusProps = { installed?: boolean; }; -const AppStatus = ({ app, showStatus = true, isAppDetailsPage, installed, ...props }: AppStatusProps): ReactElement => { +const AppStatus = ({ app, showStatus = true, isAppDetailsPage, installed, ...props }: AppStatusProps) => { const { t } = useTranslation(); const [endUserRequested, setEndUserRequested] = useState(false); const [loading, setLoading] = useSafely(useState(false)); diff --git a/apps/meteor/client/views/marketplace/AppsList/AppRow.tsx b/apps/meteor/client/views/marketplace/AppsList/AppRow.tsx index 0bc0fbc6c7dbc..31fa5634bf161 100644 --- a/apps/meteor/client/views/marketplace/AppsList/AppRow.tsx +++ b/apps/meteor/client/views/marketplace/AppsList/AppRow.tsx @@ -2,7 +2,7 @@ import type { App } from '@rocket.chat/core-typings'; import { Badge, Card, CardBody, CardCol, CardControls, CardHeader, CardRow, CardTitle } from '@rocket.chat/fuselage'; import { AppAvatar } from '@rocket.chat/ui-avatar'; import { useRouteParameter, useRouter } from '@rocket.chat/ui-contexts'; -import type { KeyboardEvent, MouseEvent, ReactElement } from 'react'; +import type { KeyboardEvent, MouseEvent } from 'react'; import { memo } from 'react'; import semver from 'semver'; @@ -12,7 +12,7 @@ import BundleChips from '../BundleChips'; import AddonChip from './AddonChip'; // TODO: org props -const AppRow = ({ className, ...props }: App & { className?: string }): ReactElement => { +const AppRow = ({ className, ...props }: App & { className?: string }) => { const { name, id, shortDescription, iconFileData, marketplaceVersion, iconFileContent, installed, bundledIn, version } = props; const router = useRouter(); diff --git a/apps/meteor/client/views/marketplace/AppsList/AppsList.tsx b/apps/meteor/client/views/marketplace/AppsList/AppsList.tsx index 8d75b39215782..0baec97ab802d 100644 --- a/apps/meteor/client/views/marketplace/AppsList/AppsList.tsx +++ b/apps/meteor/client/views/marketplace/AppsList/AppsList.tsx @@ -1,6 +1,5 @@ import type { App } from '@rocket.chat/core-typings'; import { Box, CardGroup } from '@rocket.chat/fuselage'; -import type { ReactElement } from 'react'; import AppRow from './AppRow'; @@ -10,7 +9,7 @@ type AppsListProps = { appsListId: string; }; -const AppsList = ({ apps, title, appsListId }: AppsListProps): ReactElement => { +const AppsList = ({ apps, title, appsListId }: AppsListProps) => { return ( {title && ( diff --git a/apps/meteor/client/views/marketplace/AppsPage/AppsFilters.tsx b/apps/meteor/client/views/marketplace/AppsPage/AppsFilters.tsx index cd255e7e87476..59def914c641c 100644 --- a/apps/meteor/client/views/marketplace/AppsPage/AppsFilters.tsx +++ b/apps/meteor/client/views/marketplace/AppsPage/AppsFilters.tsx @@ -1,6 +1,5 @@ import { Box } from '@rocket.chat/fuselage'; import { useBreakpoints } from '@rocket.chat/fuselage-hooks'; -import type { ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; import FilterByText from '../../../components/FilterByText'; @@ -40,7 +39,7 @@ const AppsFilters = ({ statusFilterStructure, statusFilterOnSelected, context, -}: AppsFiltersProps): ReactElement => { +}: AppsFiltersProps) => { const { t } = useTranslation(); const isPrivateAppsPage = context === 'private'; diff --git a/apps/meteor/client/views/marketplace/AppsPage/AppsPage.tsx b/apps/meteor/client/views/marketplace/AppsPage/AppsPage.tsx index 764fc38cee766..344a59e001fa8 100644 --- a/apps/meteor/client/views/marketplace/AppsPage/AppsPage.tsx +++ b/apps/meteor/client/views/marketplace/AppsPage/AppsPage.tsx @@ -1,9 +1,8 @@ import { Page } from '@rocket.chat/ui-client'; -import type { ReactElement } from 'react'; import AppsPageContent from './AppsPageContent'; -const AppsPage = (): ReactElement => { +const AppsPage = () => { return ( diff --git a/apps/meteor/client/views/marketplace/AppsPage/AppsPageConnectionError.tsx b/apps/meteor/client/views/marketplace/AppsPage/AppsPageConnectionError.tsx index 3659c658e4df4..17e1a64318ebd 100644 --- a/apps/meteor/client/views/marketplace/AppsPage/AppsPageConnectionError.tsx +++ b/apps/meteor/client/views/marketplace/AppsPage/AppsPageConnectionError.tsx @@ -1,8 +1,7 @@ import { Box, States, StatesIcon, StatesTitle, StatesSubtitle, StatesActions, StatesAction } from '@rocket.chat/fuselage'; -import type { ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; -const AppsPageContentError = ({ onButtonClick }: { onButtonClick: () => void }): ReactElement => { +const AppsPageContentError = ({ onButtonClick }: { onButtonClick: () => void }) => { const { t } = useTranslation(); return ( diff --git a/apps/meteor/client/views/marketplace/AppsPage/AppsPageContentSkeleton.tsx b/apps/meteor/client/views/marketplace/AppsPage/AppsPageContentSkeleton.tsx index a9d368415f79e..7f748713fef99 100644 --- a/apps/meteor/client/views/marketplace/AppsPage/AppsPageContentSkeleton.tsx +++ b/apps/meteor/client/views/marketplace/AppsPage/AppsPageContentSkeleton.tsx @@ -1,7 +1,6 @@ import { Skeleton, Box } from '@rocket.chat/fuselage'; -import type { ReactElement } from 'react'; -const AppsPageContentSkeleton = (): ReactElement => { +const AppsPageContentSkeleton = () => { const loadingRows = Array.from({ length: 3 }, (_, i) => ); return ( diff --git a/apps/meteor/client/views/marketplace/AppsPage/FeaturedAppsSections.tsx b/apps/meteor/client/views/marketplace/AppsPage/FeaturedAppsSections.tsx index f7179f3923748..fda21161ea180 100644 --- a/apps/meteor/client/views/marketplace/AppsPage/FeaturedAppsSections.tsx +++ b/apps/meteor/client/views/marketplace/AppsPage/FeaturedAppsSections.tsx @@ -1,5 +1,4 @@ import type { App } from '@rocket.chat/core-typings'; -import type { ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; import AppsList from '../AppsList'; @@ -11,7 +10,7 @@ type FeaturedSectionsProps = { appsListId: string; }; -const FeaturedAppsSections = ({ appsResult, appsListId }: FeaturedSectionsProps): ReactElement | null => { +const FeaturedAppsSections = ({ appsResult, appsListId }: FeaturedSectionsProps) => { const { t, i18n } = useTranslation(); const featuredApps = useFeaturedApps(); diff --git a/apps/meteor/client/views/marketplace/AppsPage/NoInstalledAppMatchesEmptyState.tsx b/apps/meteor/client/views/marketplace/AppsPage/NoInstalledAppMatchesEmptyState.tsx index 84b025daa37c2..e0086e880b36c 100644 --- a/apps/meteor/client/views/marketplace/AppsPage/NoInstalledAppMatchesEmptyState.tsx +++ b/apps/meteor/client/views/marketplace/AppsPage/NoInstalledAppMatchesEmptyState.tsx @@ -9,7 +9,6 @@ import { StatesActions, StatesAction, } from '@rocket.chat/fuselage'; -import type { ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; type NoInstalledAppMatchesEmptyStateProps = { @@ -18,11 +17,7 @@ type NoInstalledAppMatchesEmptyStateProps = { onButtonClick: () => void; }; -const NoInstalledAppMatchesEmptyState = ({ - shouldShowSearchText, - text, - onButtonClick, -}: NoInstalledAppMatchesEmptyStateProps): ReactElement => { +const NoInstalledAppMatchesEmptyState = ({ shouldShowSearchText, text, onButtonClick }: NoInstalledAppMatchesEmptyStateProps) => { const { t } = useTranslation(); return ( diff --git a/apps/meteor/client/views/marketplace/AppsPage/NoInstalledAppsEmptyState.tsx b/apps/meteor/client/views/marketplace/AppsPage/NoInstalledAppsEmptyState.tsx index 4721d7ece1300..def454f6c657a 100644 --- a/apps/meteor/client/views/marketplace/AppsPage/NoInstalledAppsEmptyState.tsx +++ b/apps/meteor/client/views/marketplace/AppsPage/NoInstalledAppsEmptyState.tsx @@ -1,8 +1,7 @@ import { Box, States, StatesIcon, StatesTitle, StatesSubtitle, StatesActions, StatesAction } from '@rocket.chat/fuselage'; -import type { ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; -const NoInstalledAppsEmptyState = ({ onButtonClick }: { onButtonClick: () => void }): ReactElement => { +const NoInstalledAppsEmptyState = ({ onButtonClick }: { onButtonClick: () => void }) => { const { t } = useTranslation(); return ( diff --git a/apps/meteor/client/views/marketplace/AppsPage/NoMarketplaceOrInstalledAppMatchesEmptyState.tsx b/apps/meteor/client/views/marketplace/AppsPage/NoMarketplaceOrInstalledAppMatchesEmptyState.tsx index ef89b55ae14a9..031f5b01b1d77 100644 --- a/apps/meteor/client/views/marketplace/AppsPage/NoMarketplaceOrInstalledAppMatchesEmptyState.tsx +++ b/apps/meteor/client/views/marketplace/AppsPage/NoMarketplaceOrInstalledAppMatchesEmptyState.tsx @@ -9,7 +9,6 @@ import { StatesSuggestionText, StatesTitle, } from '@rocket.chat/fuselage'; -import type { ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; type NoMarketplaceOrInstalledAppMatchesEmptyStateProps = { shouldShowSearchText: boolean; text: string }; @@ -17,7 +16,7 @@ type NoMarketplaceOrInstalledAppMatchesEmptyStateProps = { shouldShowSearchText: const NoMarketplaceOrInstalledAppMatchesEmptyState = ({ shouldShowSearchText, text, -}: NoMarketplaceOrInstalledAppMatchesEmptyStateProps): ReactElement => { +}: NoMarketplaceOrInstalledAppMatchesEmptyStateProps) => { const { t } = useTranslation(); return ( diff --git a/apps/meteor/client/views/marketplace/AppsPage/UnsupportedEmptyState.tsx b/apps/meteor/client/views/marketplace/AppsPage/UnsupportedEmptyState.tsx index c92bd4072c124..e4cd683b35fa5 100644 --- a/apps/meteor/client/views/marketplace/AppsPage/UnsupportedEmptyState.tsx +++ b/apps/meteor/client/views/marketplace/AppsPage/UnsupportedEmptyState.tsx @@ -1,12 +1,11 @@ import { Box, States, StatesIcon, StatesTitle, StatesSubtitle, StatesActions, Button } from '@rocket.chat/fuselage'; import { usePermission } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; import { links } from '../../../lib/links'; import UpdateRocketChatButton from '../components/UpdateRocketChatButton'; -const UnsupportedEmptyState = (): ReactElement => { +const UnsupportedEmptyState = () => { const isAdmin = usePermission('manage-apps'); const { t } = useTranslation(); diff --git a/apps/meteor/client/views/marketplace/AppsRoute.tsx b/apps/meteor/client/views/marketplace/AppsRoute.tsx index 70b3ea9922c2d..da51dae6d6c3c 100644 --- a/apps/meteor/client/views/marketplace/AppsRoute.tsx +++ b/apps/meteor/client/views/marketplace/AppsRoute.tsx @@ -1,5 +1,4 @@ import { useRouteParameter, useRoute, usePermission } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; import { useState, useEffect } from 'react'; import AppDetailsPage from './AppDetailsPage'; @@ -10,7 +9,7 @@ import PageSkeleton from '../../components/PageSkeleton'; import AppsProvider from '../../providers/AppsProvider'; import NotAuthorizedPage from '../notAuthorized/NotAuthorizedPage'; -const AppsRoute = (): ReactElement => { +const AppsRoute = () => { const [isLoading, setLoading] = useState(true); const marketplaceRoute = useRoute('marketplace'); diff --git a/apps/meteor/client/views/marketplace/BundleChips.tsx b/apps/meteor/client/views/marketplace/BundleChips.tsx index 0fe87fe9bbeb6..b287dc40ae3e0 100644 --- a/apps/meteor/client/views/marketplace/BundleChips.tsx +++ b/apps/meteor/client/views/marketplace/BundleChips.tsx @@ -1,5 +1,4 @@ import { Tag } from '@rocket.chat/fuselage'; -import type { ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; import type { App } from './types'; @@ -12,7 +11,7 @@ type BundleChipsProps = { }[]; }; -const BundleChips = ({ bundledIn }: BundleChipsProps): ReactElement => { +const BundleChips = ({ bundledIn }: BundleChipsProps) => { const { t } = useTranslation(); const handlePlanName = (label: string): string => { diff --git a/apps/meteor/client/views/marketplace/MarketplaceRouter.tsx b/apps/meteor/client/views/marketplace/MarketplaceRouter.tsx index f9ee37599112e..2d3080c915206 100644 --- a/apps/meteor/client/views/marketplace/MarketplaceRouter.tsx +++ b/apps/meteor/client/views/marketplace/MarketplaceRouter.tsx @@ -1,5 +1,5 @@ import { useAtLeastOnePermission, useRoute, useRouteParameter } from '@rocket.chat/ui-contexts'; -import type { ReactElement, ReactNode } from 'react'; +import type { ReactNode } from 'react'; import { Suspense, useEffect } from 'react'; import MarketPlaceSidebar from './MarketplaceSidebar'; @@ -7,7 +7,7 @@ import PageSkeleton from '../../components/PageSkeleton'; import SidebarPortal from '../../portals/SidebarPortal'; import NotFoundPage from '../notFound/NotFoundPage'; -const MarketplaceRouter = ({ children }: { children?: ReactNode }): ReactElement => { +const MarketplaceRouter = ({ children }: { children?: ReactNode }) => { const currentContext = useRouteParameter('context') || 'all'; const marketplaceRoute = useRoute('marketplace'); const canAccessMarketplace = useAtLeastOnePermission(['access-marketplace', 'manage-apps']); diff --git a/apps/meteor/client/views/marketplace/MarketplaceSidebar.tsx b/apps/meteor/client/views/marketplace/MarketplaceSidebar.tsx index a10e01383fb62..059a55ee31078 100644 --- a/apps/meteor/client/views/marketplace/MarketplaceSidebar.tsx +++ b/apps/meteor/client/views/marketplace/MarketplaceSidebar.tsx @@ -1,5 +1,4 @@ import { useTranslation, useLayout, useCurrentRoutePath } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; import { memo, useSyncExternalStore } from 'react'; import { getMarketplaceSidebarItems, subscribeToMarketplaceSidebarItems } from './sidebarItems'; @@ -7,7 +6,7 @@ import Sidebar from '../../components/Sidebar'; import SidebarItemsAssembler from '../../components/Sidebar/SidebarItemsAssembler'; import SettingsProvider from '../../providers/SettingsProvider'; -const MarketplaceSidebar = (): ReactElement => { +const MarketplaceSidebar = () => { const items = useSyncExternalStore(subscribeToMarketplaceSidebarItems, getMarketplaceSidebarItems); const t = useTranslation(); diff --git a/apps/meteor/client/views/marketplace/components/AppPermissionsList.tsx b/apps/meteor/client/views/marketplace/components/AppPermissionsList.tsx index 7983260071df7..0b933e002f482 100644 --- a/apps/meteor/client/views/marketplace/components/AppPermissionsList.tsx +++ b/apps/meteor/client/views/marketplace/components/AppPermissionsList.tsx @@ -1,7 +1,6 @@ import type { AppPermission } from '@rocket.chat/core-typings'; import { Box } from '@rocket.chat/fuselage'; import type { TranslationKey } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; import { Fragment } from 'react'; import { useTranslation } from 'react-i18next'; @@ -35,7 +34,7 @@ const defaultPermissions = [ 'api', ]; -const AppPermissionsList = ({ appPermissions }: { appPermissions: AppPermission[] | undefined }): ReactElement => { +const AppPermissionsList = ({ appPermissions }: { appPermissions: AppPermission[] | undefined }) => { const { t } = useTranslation(); const handleAppPermissions = (permission: string): string => t(`Apps_Permissions_${permission.replace('.', '_')}` as TranslationKey); diff --git a/apps/meteor/client/views/marketplace/components/BannerEnterpriseTrialEnded.tsx b/apps/meteor/client/views/marketplace/components/BannerEnterpriseTrialEnded.tsx index 78793e2435086..aa7cbea6e62ca 100644 --- a/apps/meteor/client/views/marketplace/components/BannerEnterpriseTrialEnded.tsx +++ b/apps/meteor/client/views/marketplace/components/BannerEnterpriseTrialEnded.tsx @@ -1,10 +1,9 @@ import { Banner, Icon } from '@rocket.chat/fuselage'; import { useLocalStorage } from '@rocket.chat/fuselage-hooks'; import { usePermission, useSetting } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; -const BannerEnterpriseTrialEnded = (): ReactElement => { +const BannerEnterpriseTrialEnded = () => { const { t } = useTranslation(); const isAdmin = usePermission('manage-apps'); diff --git a/apps/meteor/client/views/marketplace/components/CategoryFilter/CategoryDropDown.tsx b/apps/meteor/client/views/marketplace/components/CategoryFilter/CategoryDropDown.tsx index f8b8962518a29..a0069c62ce81b 100644 --- a/apps/meteor/client/views/marketplace/components/CategoryFilter/CategoryDropDown.tsx +++ b/apps/meteor/client/views/marketplace/components/CategoryFilter/CategoryDropDown.tsx @@ -1,14 +1,14 @@ import type { Button } from '@rocket.chat/fuselage'; import { useToggle } from '@rocket.chat/fuselage-hooks'; -import type { ComponentProps, ReactElement } from 'react'; +import type { ComponentProps } from 'react'; import { useRef, useCallback } from 'react'; +import CategoryDropDownAnchor from './CategoryDropDownAnchor'; +import CategoryDropDownList from './CategoryDropDownList'; import type { CategoryDropdownItem, CategoryDropDownListProps } from '../../definitions/CategoryDropdownDefinitions'; import { isValidReference } from '../../helpers/isValidReference'; import { onMouseEventPreventSideEffects } from '../../helpers/onMouseEventPreventSideEffects'; import DropDownListWrapper from '../DropDownListWrapper'; -import CategoryDropDownAnchor from './CategoryDropDownAnchor'; -import CategoryDropDownList from './CategoryDropDownList'; type CategoryDropDownProps = { categories: CategoryDropDownListProps['categories']; @@ -16,7 +16,7 @@ type CategoryDropDownProps = { selectedCategories: (CategoryDropdownItem & { checked: true })[]; } & ComponentProps; -const CategoryDropDown = ({ categories, onSelected, selectedCategories, ...props }: CategoryDropDownProps): ReactElement => { +const CategoryDropDown = ({ categories, onSelected, selectedCategories, ...props }: CategoryDropDownProps) => { const reference = useRef(null); const [collapsed, toggleCollapsed] = useToggle(false); diff --git a/apps/meteor/client/views/marketplace/components/CategoryFilter/CategoryDropDownList.tsx b/apps/meteor/client/views/marketplace/components/CategoryFilter/CategoryDropDownList.tsx index cb780d89940fa..548ea390f7e64 100644 --- a/apps/meteor/client/views/marketplace/components/CategoryFilter/CategoryDropDownList.tsx +++ b/apps/meteor/client/views/marketplace/components/CategoryFilter/CategoryDropDownList.tsx @@ -1,10 +1,9 @@ import { Box, CheckBox, Option, Tile } from '@rocket.chat/fuselage'; -import type { ReactElement } from 'react'; import { Fragment } from 'react'; import type { CategoryDropDownListProps } from '../../definitions/CategoryDropdownDefinitions'; -const CategoryDropDownList = ({ categories, onSelected }: CategoryDropDownListProps): ReactElement => { +const CategoryDropDownList = ({ categories, onSelected }: CategoryDropDownListProps) => { return ( {categories.map((category, index) => ( diff --git a/apps/meteor/client/views/marketplace/components/EnabledAppsCount.tsx b/apps/meteor/client/views/marketplace/components/EnabledAppsCount.tsx index ad443493ec61c..0f1223fb15f7b 100644 --- a/apps/meteor/client/views/marketplace/components/EnabledAppsCount.tsx +++ b/apps/meteor/client/views/marketplace/components/EnabledAppsCount.tsx @@ -1,4 +1,3 @@ -import type { ReactElement } from 'react'; import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; @@ -14,7 +13,7 @@ const EnabledAppsCount = ({ enabled: number; context: 'private' | 'explore' | 'installed' | 'premium' | 'requested'; tooltip?: string; -}): ReactElement | null => { +}) => { const { t } = useTranslation(); const variant = useMemo(() => { diff --git a/apps/meteor/client/views/marketplace/components/MarketplaceHeader.tsx b/apps/meteor/client/views/marketplace/components/MarketplaceHeader.tsx index 12fda34a88c0d..f2d4c2b9b1b4e 100644 --- a/apps/meteor/client/views/marketplace/components/MarketplaceHeader.tsx +++ b/apps/meteor/client/views/marketplace/components/MarketplaceHeader.tsx @@ -1,7 +1,6 @@ import { Button, ButtonGroup, Margins } from '@rocket.chat/fuselage'; import { PageHeader } from '@rocket.chat/ui-client'; import { usePermission, useRoute, useRouteParameter, useSetModal } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; import { GenericResourceUsageSkeleton } from '../../../components/GenericResourceUsage'; @@ -13,7 +12,7 @@ import { usePrivateAppsEnabled } from '../hooks/usePrivateAppsEnabled'; import PrivateAppInstallModal from './PrivateAppInstallModal/PrivateAppInstallModal'; import UpdateRocketChatButton from './UpdateRocketChatButton'; -const MarketplaceHeader = ({ title, unsupportedVersion }: { title: string; unsupportedVersion: boolean }): ReactElement | null => { +const MarketplaceHeader = ({ title, unsupportedVersion }: { title: string; unsupportedVersion: boolean }) => { const { t } = useTranslation(); const isAdmin = usePermission('manage-apps'); const context = (useRouteParameter('context') || 'explore') as 'private' | 'explore' | 'installed' | 'premium' | 'requested'; diff --git a/apps/meteor/client/views/marketplace/components/RadioButtonList.tsx b/apps/meteor/client/views/marketplace/components/RadioButtonList.tsx index 3f3cd0373824e..465d15cc6a538 100644 --- a/apps/meteor/client/views/marketplace/components/RadioButtonList.tsx +++ b/apps/meteor/client/views/marketplace/components/RadioButtonList.tsx @@ -1,9 +1,8 @@ import { Box, Option, RadioButton, Tile } from '@rocket.chat/fuselage'; -import type { ReactElement } from 'react'; import type { RadioDropDownProps } from '../definitions/RadioDropDownDefinitions'; -const RadioButtonList = ({ group, onSelected }: RadioDropDownProps): ReactElement => ( +const RadioButtonList = ({ group, onSelected }: RadioDropDownProps) => ( {group.label && ( diff --git a/apps/meteor/client/views/marketplace/components/RadioDropDown/RadioDropDown.tsx b/apps/meteor/client/views/marketplace/components/RadioDropDown/RadioDropDown.tsx index 7b5a738302257..98affc5276df5 100644 --- a/apps/meteor/client/views/marketplace/components/RadioDropDown/RadioDropDown.tsx +++ b/apps/meteor/client/views/marketplace/components/RadioDropDown/RadioDropDown.tsx @@ -1,16 +1,16 @@ import type { Button } from '@rocket.chat/fuselage'; import { useToggle } from '@rocket.chat/fuselage-hooks'; -import type { ComponentProps, ReactElement } from 'react'; +import type { ComponentProps } from 'react'; import { useCallback, useRef } from 'react'; +import RadioDropDownAnchor from './RadioDownAnchor'; import type { RadioDropDownProps } from '../../definitions/RadioDropDownDefinitions'; import { isValidReference } from '../../helpers/isValidReference'; import { onMouseEventPreventSideEffects } from '../../helpers/onMouseEventPreventSideEffects'; import DropDownListWrapper from '../DropDownListWrapper'; import RadioButtonList from '../RadioButtonList'; -import RadioDropDownAnchor from './RadioDownAnchor'; -const RadioDropDown = ({ group, onSelected, ...props }: RadioDropDownProps & ComponentProps): ReactElement => { +const RadioDropDown = ({ group, onSelected, ...props }: RadioDropDownProps & ComponentProps) => { const reference = useRef(null); const [collapsed, toggleCollapsed] = useToggle(false); diff --git a/apps/meteor/client/views/marketplace/components/ScreenshotCarousel.tsx b/apps/meteor/client/views/marketplace/components/ScreenshotCarousel.tsx index e58fa6d0ee8cb..4d0469141d869 100644 --- a/apps/meteor/client/views/marketplace/components/ScreenshotCarousel.tsx +++ b/apps/meteor/client/views/marketplace/components/ScreenshotCarousel.tsx @@ -1,6 +1,5 @@ import type { AppScreenshot } from '@rocket.chat/core-typings'; import { Box, IconButton } from '@rocket.chat/fuselage'; -import type { ReactElement } from 'react'; type ScreenshotCarouselProps = { AppScreenshots: Array; @@ -20,8 +19,8 @@ const ScreenshotCarousel = ({ isFirstSlide, isLastSlide, currentSlideIndex, -}: ScreenshotCarouselProps): ReactElement => { - const handleScreenshotRender = (): JSX.Element[] => +}: ScreenshotCarouselProps) => { + const handleScreenshotRender = () => AppScreenshots.map((currentScreenshot, index) => { const isCurrentImageOnScreen = index === currentSlideIndex; const screenshotWrapperStyle = isCurrentImageOnScreen diff --git a/apps/meteor/client/views/marketplace/components/ScreenshotCarouselAnchor.tsx b/apps/meteor/client/views/marketplace/components/ScreenshotCarouselAnchor.tsx index 4bc361d5ff04d..a2a4ecec0f59e 100644 --- a/apps/meteor/client/views/marketplace/components/ScreenshotCarouselAnchor.tsx +++ b/apps/meteor/client/views/marketplace/components/ScreenshotCarouselAnchor.tsx @@ -1,7 +1,6 @@ import type { AppScreenshot } from '@rocket.chat/core-typings'; import { css } from '@rocket.chat/css-in-js'; import { Box, Icon } from '@rocket.chat/fuselage'; -import type { ReactElement } from 'react'; import { useCallback, useEffect, useState } from 'react'; import { createPortal } from 'react-dom'; @@ -13,7 +12,7 @@ type ScreenshotCarouselAnchorProps = { type voidFunction = () => void; -const ScreenshotCarouselAnchor = ({ screenshots }: ScreenshotCarouselAnchorProps): ReactElement => { +const ScreenshotCarouselAnchor = ({ screenshots }: ScreenshotCarouselAnchorProps) => { const [viewCarousel, setViewCarousel] = useState(false); const [currentSlideIndex, setCurrentSlideIndex] = useState(0); diff --git a/apps/meteor/client/views/marketplace/helpers/isValidReference.tsx b/apps/meteor/client/views/marketplace/helpers/isValidReference.tsx index 3dd615b4a1835..f56cf2cdbaa81 100644 --- a/apps/meteor/client/views/marketplace/helpers/isValidReference.tsx +++ b/apps/meteor/client/views/marketplace/helpers/isValidReference.tsx @@ -1,6 +1,6 @@ import type { RefObject } from 'react'; -export const isValidReference = (reference: RefObject, e: { target: Node | null }): boolean => { +export const isValidReference = (reference: RefObject, e: { target: Node | null }): boolean => { const isValidTarget = Boolean(e.target); const isValidReference = e.target !== reference.current && !reference.current?.contains(e.target); diff --git a/apps/meteor/client/views/modal/uikit/ModalBlock.tsx b/apps/meteor/client/views/modal/uikit/ModalBlock.tsx index abaaebe20b330..681c01c06ca65 100644 --- a/apps/meteor/client/views/modal/uikit/ModalBlock.tsx +++ b/apps/meteor/client/views/modal/uikit/ModalBlock.tsx @@ -14,7 +14,7 @@ import { } from '@rocket.chat/fuselage'; import { UiKitComponent, UiKitModal, modalParser } from '@rocket.chat/fuselage-ui-kit'; import type * as UiKit from '@rocket.chat/ui-kit'; -import type { FormEvent, FormEventHandler, ReactElement } from 'react'; +import type { FormEvent, FormEventHandler } from 'react'; import { useId, useCallback, useEffect, useMemo, useRef } from 'react'; import { getButtonStyle } from './getButtonStyle'; @@ -64,7 +64,7 @@ const KeyboardCode = new Map([ ['TAB', 9], ]); -const ModalBlock = ({ view, errors, onSubmit, onClose, onCancel }: ModalBlockParams): ReactElement => { +const ModalBlock = ({ view, errors, onSubmit, onClose, onCancel }: ModalBlockParams) => { const id = `modal_id_${useId()}`; const ref = useRef(null); diff --git a/apps/meteor/client/views/navigation/sidebar/RoomList/SidebarItem.tsx b/apps/meteor/client/views/navigation/sidebar/RoomList/SidebarItem.tsx index 093decdd2ef14..f94a30524625e 100644 --- a/apps/meteor/client/views/navigation/sidebar/RoomList/SidebarItem.tsx +++ b/apps/meteor/client/views/navigation/sidebar/RoomList/SidebarItem.tsx @@ -1,7 +1,7 @@ import { IconButton, SidebarV2Item, SidebarV2ItemAvatarWrapper, SidebarV2ItemMenu, SidebarV2ItemTitle } from '@rocket.chat/fuselage'; import { RoomAvatar } from '@rocket.chat/ui-avatar'; import type { SubscriptionWithRoom } from '@rocket.chat/ui-contexts'; -import type { HTMLAttributes, ReactElement, ReactNode } from 'react'; +import type { HTMLAttributes, ReactNode } from 'react'; import { memo } from 'react'; import { useDeferredMenuMount } from '../../../../sidebar/Item/useDeferredMenuMount'; @@ -13,7 +13,7 @@ type SidebarItemProps = { actions?: ReactNode; href?: string; unread?: boolean; - menu?: ReactElement; + menu?: ReactNode; menuOptions?: any; selected?: boolean; badges?: ReactNode; diff --git a/apps/meteor/client/views/navigation/sidebar/hooks/usePreventDefault.ts b/apps/meteor/client/views/navigation/sidebar/hooks/usePreventDefault.ts index 398c6d4afd03c..be327b0b06086 100644 --- a/apps/meteor/client/views/navigation/sidebar/hooks/usePreventDefault.ts +++ b/apps/meteor/client/views/navigation/sidebar/hooks/usePreventDefault.ts @@ -1,7 +1,7 @@ import type { RefObject } from 'react'; import { useEffect } from 'react'; -export const usePreventDefault = (ref: RefObject): { ref: RefObject } => { +export const usePreventDefault = (ref: RefObject): { ref: RefObject } => { // Flowrouter uses an addEventListener on the document to capture any clink link, since the react synthetic event use an addEventListener on the document too, // it is impossible/hard to determine which one will happen before and prevent/stop propagation, so feel free to remove this effect after remove flow router :) diff --git a/apps/meteor/client/views/navigation/sidebar/hooks/useShortcutOpenMenu.ts b/apps/meteor/client/views/navigation/sidebar/hooks/useShortcutOpenMenu.ts index 84ff9f7cf5b61..f025cd96d4ea0 100644 --- a/apps/meteor/client/views/navigation/sidebar/hooks/useShortcutOpenMenu.ts +++ b/apps/meteor/client/views/navigation/sidebar/hooks/useShortcutOpenMenu.ts @@ -3,7 +3,7 @@ import { useEffect } from 'react'; import tinykeys from 'tinykeys'; // used to open the menu option by keyboard -export const useShortcutOpenMenu = (ref: RefObject): void => { +export const useShortcutOpenMenu = (ref: RefObject): void => { useEffect(() => { const unsubscribe = tinykeys(ref.current as HTMLElement, { Alt: (event) => { diff --git a/apps/meteor/client/views/navigation/sidepanel/SidepanelItem/SidepanelItem.tsx b/apps/meteor/client/views/navigation/sidepanel/SidepanelItem/SidepanelItem.tsx index a970a8db6be2c..7c015b42280e6 100644 --- a/apps/meteor/client/views/navigation/sidepanel/SidepanelItem/SidepanelItem.tsx +++ b/apps/meteor/client/views/navigation/sidepanel/SidepanelItem/SidepanelItem.tsx @@ -10,7 +10,7 @@ import { SidebarV2ItemTitle, } from '@rocket.chat/fuselage'; import { useLayout } from '@rocket.chat/ui-contexts'; -import type { ReactElement, ReactNode } from 'react'; +import type { ReactNode } from 'react'; import { memo, useState } from 'react'; import { useShortTimeAgo } from '../../../../hooks/useTimeAgo'; @@ -23,10 +23,10 @@ type SidePanelItemProps = { icon: ReactNode; unread: boolean; time?: Date; - subtitle: ReactElement | null; + subtitle: ReactNode; parentRoom?: ReactNode; - badges?: ReactElement; - menu?: ReactElement; + badges?: ReactNode; + menu?: ReactNode; }; const SidePanelItem = ({ diff --git a/apps/meteor/client/views/notAuthorized/NotAuthorizedPage.tsx b/apps/meteor/client/views/notAuthorized/NotAuthorizedPage.tsx index 0ab0f17961474..fb66fb0557da9 100644 --- a/apps/meteor/client/views/notAuthorized/NotAuthorizedPage.tsx +++ b/apps/meteor/client/views/notAuthorized/NotAuthorizedPage.tsx @@ -1,9 +1,8 @@ import { Box } from '@rocket.chat/fuselage'; import { Page, PageContent } from '@rocket.chat/ui-client'; -import type { ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; -const NotAuthorizedPage = (): ReactElement => { +const NotAuthorizedPage = () => { const { t } = useTranslation(); return ( diff --git a/apps/meteor/client/views/notFound/NotFoundPage.tsx b/apps/meteor/client/views/notFound/NotFoundPage.tsx index f841ee4695c1a..0855615d8a584 100644 --- a/apps/meteor/client/views/notFound/NotFoundPage.tsx +++ b/apps/meteor/client/views/notFound/NotFoundPage.tsx @@ -1,9 +1,8 @@ -import type { ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; import NotFoundState from '../../components/NotFoundState'; -const NotFoundPage = (): ReactElement => { +const NotFoundPage = () => { const { t } = useTranslation(); return ; }; diff --git a/apps/meteor/client/views/omnichannel/OmnichannelRouter.tsx b/apps/meteor/client/views/omnichannel/OmnichannelRouter.tsx index 400d3fa494256..ec86af87b5e23 100644 --- a/apps/meteor/client/views/omnichannel/OmnichannelRouter.tsx +++ b/apps/meteor/client/views/omnichannel/OmnichannelRouter.tsx @@ -1,5 +1,5 @@ import { useRouter } from '@rocket.chat/ui-contexts'; -import type { ReactNode, ReactElement } from 'react'; +import type { ReactNode } from 'react'; import { Suspense, useEffect } from 'react'; import OmnichannelSidebar from './sidebar/OmnichannelSidebar'; @@ -10,7 +10,7 @@ type OmnichannelRouterProps = { children?: ReactNode; }; -const OmnichannelRouter = ({ children }: OmnichannelRouterProps): ReactElement => { +const OmnichannelRouter = ({ children }: OmnichannelRouterProps) => { const router = useRouter(); useEffect( diff --git a/apps/meteor/client/views/omnichannel/additionalForms/AutoCompleteUnits.tsx b/apps/meteor/client/views/omnichannel/additionalForms/AutoCompleteUnits.tsx index b41f5e72a26f6..8f795996a5602 100644 --- a/apps/meteor/client/views/omnichannel/additionalForms/AutoCompleteUnits.tsx +++ b/apps/meteor/client/views/omnichannel/additionalForms/AutoCompleteUnits.tsx @@ -1,6 +1,6 @@ import { PaginatedMultiSelectFiltered } from '@rocket.chat/fuselage'; import { useDebouncedValue } from '@rocket.chat/fuselage-hooks'; -import type { ComponentProps, ReactElement } from 'react'; +import type { ComponentProps } from 'react'; import { memo, useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -11,7 +11,7 @@ type AutoCompleteUnitsProps = Omit< 'filter' | 'setFilter' | 'options' | 'endReached' | 'renderItem' >; -const AutoCompleteUnits = ({ value, placeholder, onChange, ...props }: AutoCompleteUnitsProps): ReactElement => { +const AutoCompleteUnits = ({ value, placeholder, onChange, ...props }: AutoCompleteUnitsProps) => { const { t } = useTranslation(); const [unitsFilter, setUnitsFilter] = useState(''); const debouncedUnitFilter = useDebouncedValue(unitsFilter, 500); diff --git a/apps/meteor/client/views/omnichannel/agents/AgentEditWithData.tsx b/apps/meteor/client/views/omnichannel/agents/AgentEditWithData.tsx index f53797805775e..5262cac2b13a2 100644 --- a/apps/meteor/client/views/omnichannel/agents/AgentEditWithData.tsx +++ b/apps/meteor/client/views/omnichannel/agents/AgentEditWithData.tsx @@ -3,13 +3,12 @@ import { Box } from '@rocket.chat/fuselage'; import { ContextualbarSkeletonBody } from '@rocket.chat/ui-client'; import { useEndpoint } from '@rocket.chat/ui-contexts'; import { useQuery } from '@tanstack/react-query'; -import type { ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; import AgentEdit from './AgentEdit'; import { omnichannelQueryKeys } from '../../../lib/queryKeys'; -const AgentEditWithData = ({ uid }: { uid: ILivechatAgent['_id'] }): ReactElement => { +const AgentEditWithData = ({ uid }: { uid: ILivechatAgent['_id'] }) => { const { t } = useTranslation(); const getAgentById = useEndpoint('GET', '/v1/livechat/users/agent/:_id', { _id: uid }); diff --git a/apps/meteor/client/views/omnichannel/agents/AgentsPage.tsx b/apps/meteor/client/views/omnichannel/agents/AgentsPage.tsx index ae6ac7c0a7d07..b6b08ddd52958 100644 --- a/apps/meteor/client/views/omnichannel/agents/AgentsPage.tsx +++ b/apps/meteor/client/views/omnichannel/agents/AgentsPage.tsx @@ -1,7 +1,6 @@ import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; import { ContextualbarDialog, Page, PageHeader, PageContent } from '@rocket.chat/ui-client'; import { usePermission, useRouteParameter, useRouter } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; import AgentEditWithData from './AgentEditWithData'; @@ -9,7 +8,7 @@ import AgentInfo from './AgentInfo'; import AgentsTable from './AgentsTable'; import NotAuthorizedPage from '../../notAuthorized/NotAuthorizedPage'; -const AgentsPage = (): ReactElement => { +const AgentsPage = () => { const { t } = useTranslation(); const canViewAgents = usePermission('manage-livechat-agents'); diff --git a/apps/meteor/client/views/omnichannel/agents/AgentsTable/AgentsTableRow.tsx b/apps/meteor/client/views/omnichannel/agents/AgentsTable/AgentsTableRow.tsx index 4cff09defc94e..9b5ab20c87878 100644 --- a/apps/meteor/client/views/omnichannel/agents/AgentsTable/AgentsTableRow.tsx +++ b/apps/meteor/client/views/omnichannel/agents/AgentsTable/AgentsTableRow.tsx @@ -2,7 +2,6 @@ import { Box, IconButton } from '@rocket.chat/fuselage'; import { UserAvatar } from '@rocket.chat/ui-avatar'; import { GenericTableRow, GenericTableCell } from '@rocket.chat/ui-client'; import { useRouter } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; import { useRemoveAgent } from '../hooks/useRemoveAgent'; @@ -20,7 +19,7 @@ const AgentsTableRow = ({ statusLivechat: string; }; mediaQuery: boolean; -}): ReactElement => { +}) => { const { t } = useTranslation(); const router = useRouter(); diff --git a/apps/meteor/client/views/omnichannel/analytics/InterchangeableChart.tsx b/apps/meteor/client/views/omnichannel/analytics/InterchangeableChart.tsx index de6b3fe3f400a..87a8c2c4cd953 100644 --- a/apps/meteor/client/views/omnichannel/analytics/InterchangeableChart.tsx +++ b/apps/meteor/client/views/omnichannel/analytics/InterchangeableChart.tsx @@ -51,7 +51,7 @@ const InterchangeableChart = ({ const dispatchToastMessage = useToastMessageDispatch(); const canvas = useRef(null); - const context = useRef>(); + const context = useRef>(undefined); const { start, end } = dateRange; diff --git a/apps/meteor/client/views/omnichannel/cannedResponses/components/CannedResponsesComposer/InsertPlaceholderDropdown.tsx b/apps/meteor/client/views/omnichannel/cannedResponses/components/CannedResponsesComposer/InsertPlaceholderDropdown.tsx index 0bff09fa387c2..182e449bdb0f8 100644 --- a/apps/meteor/client/views/omnichannel/cannedResponses/components/CannedResponsesComposer/InsertPlaceholderDropdown.tsx +++ b/apps/meteor/client/views/omnichannel/cannedResponses/components/CannedResponsesComposer/InsertPlaceholderDropdown.tsx @@ -6,7 +6,7 @@ import { useTranslation } from 'react-i18next'; type InsertPlaceholderDropdownProps = { onChange: (value: string) => void; - textAreaRef: RefObject; + textAreaRef: RefObject; setVisible: Dispatch>; }; diff --git a/apps/meteor/client/views/omnichannel/cannedResponses/contextualBar/CannedResponse/CannedResponseList.tsx b/apps/meteor/client/views/omnichannel/cannedResponses/contextualBar/CannedResponse/CannedResponseList.tsx index 9d2df044c3201..516a70ee0143d 100644 --- a/apps/meteor/client/views/omnichannel/cannedResponses/contextualBar/CannedResponse/CannedResponseList.tsx +++ b/apps/meteor/client/views/omnichannel/cannedResponses/contextualBar/CannedResponse/CannedResponseList.tsx @@ -11,7 +11,7 @@ import { ContextualbarDialog, } from '@rocket.chat/ui-client'; import { useRoomToolbox } from '@rocket.chat/ui-contexts'; -import type { Dispatch, FormEventHandler, MouseEvent, ReactElement, SetStateAction } from 'react'; +import type { Dispatch, FormEventHandler, MouseEvent, SetStateAction } from 'react'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; import { Virtuoso } from 'react-virtuoso'; @@ -111,7 +111,7 @@ const CannedResponseList = ({ endReached={loadMoreItems} overscan={25} data={cannedItems} - itemContent={(_index, data): ReactElement => ( + itemContent={(_index, data) => ( & { shortName?: string; }; -const AgentInfoDetails = ({ name, shortName, status = , ...props }: AgentInfoDetailsProps): ReactElement => ( +const AgentInfoDetails = ({ name, shortName, status = , ...props }: AgentInfoDetailsProps) => ( { +}: AutoCompleteAgentProps) => { const [agentsFilter, setAgentsFilter] = useState(''); const debouncedAgentsFilter = useDebouncedValue(agentsFilter, 500); diff --git a/apps/meteor/client/views/omnichannel/components/AutoCompleteContact/AutoCompleteContact.tsx b/apps/meteor/client/views/omnichannel/components/AutoCompleteContact/AutoCompleteContact.tsx index 5c594c60cd158..ae17c1b36e0f9 100644 --- a/apps/meteor/client/views/omnichannel/components/AutoCompleteContact/AutoCompleteContact.tsx +++ b/apps/meteor/client/views/omnichannel/components/AutoCompleteContact/AutoCompleteContact.tsx @@ -2,7 +2,7 @@ import type { Serialized } from '@rocket.chat/core-typings'; import { PaginatedSelectFiltered } from '@rocket.chat/fuselage'; import { useDebouncedValue } from '@rocket.chat/fuselage-hooks'; import type { ILivechatContactWithManagerData } from '@rocket.chat/rest-typings'; -import type { ComponentProps, ReactElement, SyntheticEvent } from 'react'; +import type { ComponentProps, ReactNode, SyntheticEvent } from 'react'; import { memo, useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -25,10 +25,10 @@ type AutoCompleteContactProps = Omit< > & { value: string; onChange: (value: string) => void; - renderItem?: (props: OptionProps, contact: Serialized) => ReactElement; + renderItem?: (props: OptionProps, contact: Serialized) => ReactNode; }; -const AutoCompleteContact = ({ value, placeholder, disabled, renderItem, onChange, ...props }: AutoCompleteContactProps): ReactElement => { +const AutoCompleteContact = ({ value, placeholder, disabled, renderItem, onChange, ...props }: AutoCompleteContactProps) => { const { t } = useTranslation(); const [contactsFilter, setContactFilter] = useState(''); const debouncedContactFilter = useDebouncedValue(contactsFilter, 500); diff --git a/apps/meteor/client/views/omnichannel/components/AutoCompleteDepartment.tsx b/apps/meteor/client/views/omnichannel/components/AutoCompleteDepartment.tsx index 241bf46fdb3f9..989d40530f752 100644 --- a/apps/meteor/client/views/omnichannel/components/AutoCompleteDepartment.tsx +++ b/apps/meteor/client/views/omnichannel/components/AutoCompleteDepartment.tsx @@ -1,6 +1,6 @@ import { Option, PaginatedSelectFiltered } from '@rocket.chat/fuselage'; import { useDebouncedValue } from '@rocket.chat/fuselage-hooks'; -import type { ComponentProps, ReactElement } from 'react'; +import type { ComponentProps } from 'react'; import { memo, useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -28,7 +28,7 @@ const AutoCompleteDepartment = ({ showArchived = false, disabled, ...props -}: AutoCompleteDepartmentProps): ReactElement | null => { +}: AutoCompleteDepartmentProps) => { const { t } = useTranslation(); const [departmentsFilter, setDepartmentsFilter] = useState(''); diff --git a/apps/meteor/client/views/omnichannel/components/AutoCompleteMonitors.tsx b/apps/meteor/client/views/omnichannel/components/AutoCompleteMonitors.tsx index e8a4067bbbfe1..22a57e8fbacea 100644 --- a/apps/meteor/client/views/omnichannel/components/AutoCompleteMonitors.tsx +++ b/apps/meteor/client/views/omnichannel/components/AutoCompleteMonitors.tsx @@ -1,6 +1,6 @@ import { CheckOption, PaginatedMultiSelectFiltered } from '@rocket.chat/fuselage'; import { useDebouncedValue } from '@rocket.chat/fuselage-hooks'; -import type { ComponentProps, ReactElement } from 'react'; +import type { ComponentProps } from 'react'; import { memo, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -11,7 +11,7 @@ type AutoCompleteMonitorsProps = Omit< 'options' | 'setFilter' | 'endReached' | 'filter' | 'renderItem' >; -const AutoCompleteMonitors = ({ value = [], onBlur, onChange, ...props }: AutoCompleteMonitorsProps): ReactElement => { +const AutoCompleteMonitors = ({ value = [], onBlur, onChange, ...props }: AutoCompleteMonitorsProps) => { const { t } = useTranslation(); const [monitorsFilter, setMonitorsFilter] = useState(''); const debouncedMonitorsFilter = useDebouncedValue(monitorsFilter, 500); diff --git a/apps/meteor/client/views/omnichannel/components/AutoCompleteMultipleAgent.tsx b/apps/meteor/client/views/omnichannel/components/AutoCompleteMultipleAgent.tsx index d82ba064b9ba1..c9a1c57d5e3f9 100644 --- a/apps/meteor/client/views/omnichannel/components/AutoCompleteMultipleAgent.tsx +++ b/apps/meteor/client/views/omnichannel/components/AutoCompleteMultipleAgent.tsx @@ -1,7 +1,7 @@ import type { PaginatedMultiSelectOption } from '@rocket.chat/fuselage'; import { PaginatedMultiSelectFiltered } from '@rocket.chat/fuselage'; import { useDebouncedValue } from '@rocket.chat/fuselage-hooks'; -import type { ComponentProps, ReactElement } from 'react'; +import type { ComponentProps } from 'react'; import { memo, useState } from 'react'; import { useAgentsList } from '../hooks/useAgentsList'; @@ -27,7 +27,7 @@ const AutoCompleteMultipleAgent = ({ withTitle = false, onChange, ...props -}: AutoCompleteMultipleAgentProps): ReactElement => { +}: AutoCompleteMultipleAgentProps) => { const [agentsFilter, setAgentsFilter] = useState(''); const debouncedAgentsFilter = useDebouncedValue(agentsFilter, 500); diff --git a/apps/meteor/client/views/omnichannel/components/RoomActivityIcon.tsx b/apps/meteor/client/views/omnichannel/components/RoomActivityIcon.tsx index 7458119b1c8b1..8e74f7b59c1e5 100644 --- a/apps/meteor/client/views/omnichannel/components/RoomActivityIcon.tsx +++ b/apps/meteor/client/views/omnichannel/components/RoomActivityIcon.tsx @@ -1,6 +1,5 @@ import type { IOmnichannelRoom } from '@rocket.chat/core-typings'; import { Icon } from '@rocket.chat/fuselage'; -import type { ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; import { useIsRoomOverMacLimit } from '../hooks/useIsRoomOverMacLimit'; @@ -9,7 +8,7 @@ type RoomActivityIconProps = { room: IOmnichannelRoom; }; -const RoomActivityIcon = ({ room }: RoomActivityIconProps): ReactElement | null => { +const RoomActivityIcon = ({ room }: RoomActivityIconProps) => { const { t } = useTranslation(); const isRoomOverMacLimit = useIsRoomOverMacLimit(room); diff --git a/apps/meteor/client/views/omnichannel/components/Tags.tsx b/apps/meteor/client/views/omnichannel/components/Tags.tsx index f5a8e96ee6455..61d2c049740ed 100644 --- a/apps/meteor/client/views/omnichannel/components/Tags.tsx +++ b/apps/meteor/client/views/omnichannel/components/Tags.tsx @@ -1,7 +1,7 @@ import { TextInput, Chip, Button, FieldLabel, FieldRow } from '@rocket.chat/fuselage'; import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; import { useToastMessageDispatch } from '@rocket.chat/ui-contexts'; -import type { ChangeEvent, ReactElement } from 'react'; +import type { ChangeEvent } from 'react'; import { useId, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -17,7 +17,7 @@ type TagsProps = { department?: string; }; -const Tags = ({ tags = [], handler, error, tagRequired, department }: TagsProps): ReactElement => { +const Tags = ({ tags = [], handler, error, tagRequired, department }: TagsProps) => { const { t } = useTranslation(); const tagsFieldId = useId(); @@ -71,7 +71,7 @@ const Tags = ({ tags = [], handler, error, tagRequired, department }: TagsProps) {t('Tags')} - {tagsResult?.tags && tagsResult?.tags.length ? ( + {tagsResult?.tags?.length ? ( , 'onChange'> & { @@ -39,7 +39,7 @@ const AutoCompleteDepartmentAgent = ({ value, onChange, agents, placeholder, ... value={value} onChange={onChange as (value: string | string[]) => void} options={options} - renderSelected={({ selected: { value, label }, ...props }): ReactElement => { + renderSelected={({ selected: { value, label }, ...props }) => { return ( onChange('')} mie={4}> @@ -49,7 +49,7 @@ const AutoCompleteDepartmentAgent = ({ value, onChange, agents, placeholder, ... ); }} - renderItem={({ value, label, ...props }): ReactElement => ( + renderItem={({ value, label, ...props }) => (