diff --git a/src/components/search-card/index.tsx b/src/components/search-card/index.tsx index e2a040729..ca821bdd1 100644 --- a/src/components/search-card/index.tsx +++ b/src/components/search-card/index.tsx @@ -1,6 +1,6 @@ import { Box, Flex, Text, IconCaret } from '@vtex/brand-ui' import { IconComponent } from 'utils/typings/types' -import type { SearchDataItemProps } from 'pages/search' +import type { SearchDataItemProps } from 'components/search-results' import { methodStyle } from './functions' import styles from './styles' diff --git a/src/components/search-results/index.tsx b/src/components/search-results/index.tsx index ee68513ac..2388e9fa8 100644 --- a/src/components/search-results/index.tsx +++ b/src/components/search-results/index.tsx @@ -1,20 +1,12 @@ -import { IconComponent } from 'utils/typings/types' -import APIGuidesIcon from 'components/icons/api-guides-icon' -import APIReferenceIcon from 'components/icons/api-reference-icon' -import VTEXIOIcon from 'components/icons/vtex-io-icon' -import FastStoreIcon from 'components/icons/fast-store-icon' -import WebOpsIcon from 'components/icons/webops-icon' -import ReleaseNotesIcon from 'components/icons/release-notes-icon' -import DocumentationUpdatesIcon from 'components/icons/documentation-updates-icon' -import SearchCard from 'components/search-card' -import { - DocumentationTitle, - UpdatesTitle, - MethodType, -} from 'utils/typings/unionTypes' -import { ActionType } from 'components/last-updates-card/functions' import { useRouter } from 'next/router' import { Box, Text } from '@vtex/brand-ui' + +import { MethodType } from 'utils/typings/unionTypes' + +import { getIcon } from 'utils/constants' +import SearchCard from 'components/search-card' + +import { ActionType } from 'components/last-updates-card/functions' import styles from './styles' export interface SearchDataItemProps { @@ -26,57 +18,6 @@ export interface SearchDataItemProps { actionType?: ActionType } -export interface DocDataElement { - Icon: IconComponent - title: DocumentationTitle -} - -export interface UpdatesDataElement { - Icon: IconComponent - title: UpdatesTitle -} - -export const docsIcons: DocDataElement[] = [ - { - Icon: APIGuidesIcon, - title: 'API Guides', - }, - { - Icon: APIReferenceIcon, - title: 'API Reference', - }, - { - Icon: VTEXIOIcon, - title: 'VTEX IO', - }, - { - Icon: FastStoreIcon, - title: 'FastStore', - }, - { - Icon: WebOpsIcon, - title: 'WebOps', - }, -] - -export const notesIcons: UpdatesDataElement[] = [ - { - Icon: ReleaseNotesIcon, - title: 'Release Notes', - }, - { - Icon: DocumentationUpdatesIcon, - title: 'Documentation Updates', - }, -] - -const getIcon = (doc: string) => { - return ( - docsIcons.find((icon) => icon.title === doc)?.Icon || - notesIcons.find((icon) => icon.title === doc)?.Icon - ) -} - const SearchResults = () => { const router = useRouter()