@lobehub/chat 1.17.7 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @lobehub/chat might be problematic. Click here for more details.
- package/CHANGELOG.md +25 -0
- package/locales/ar/common.json +1 -1
- package/locales/ar/discover.json +204 -0
- package/locales/ar/metadata.json +20 -3
- package/locales/ar/models.json +845 -0
- package/locales/ar/providers.json +80 -0
- package/locales/bg-BG/common.json +1 -1
- package/locales/bg-BG/discover.json +204 -0
- package/locales/bg-BG/metadata.json +20 -3
- package/locales/bg-BG/models.json +845 -0
- package/locales/bg-BG/providers.json +80 -0
- package/locales/de-DE/common.json +1 -1
- package/locales/de-DE/discover.json +204 -0
- package/locales/de-DE/metadata.json +20 -3
- package/locales/de-DE/models.json +845 -0
- package/locales/de-DE/providers.json +80 -0
- package/locales/en-US/common.json +1 -1
- package/locales/en-US/discover.json +204 -0
- package/locales/en-US/metadata.json +20 -3
- package/locales/en-US/models.json +845 -0
- package/locales/en-US/providers.json +80 -0
- package/locales/es-ES/common.json +1 -1
- package/locales/es-ES/discover.json +204 -0
- package/locales/es-ES/metadata.json +20 -3
- package/locales/es-ES/models.json +845 -0
- package/locales/es-ES/providers.json +80 -0
- package/locales/fr-FR/common.json +1 -1
- package/locales/fr-FR/discover.json +204 -0
- package/locales/fr-FR/metadata.json +20 -3
- package/locales/fr-FR/models.json +845 -0
- package/locales/fr-FR/providers.json +80 -0
- package/locales/it-IT/common.json +1 -1
- package/locales/it-IT/discover.json +204 -0
- package/locales/it-IT/metadata.json +20 -3
- package/locales/it-IT/models.json +845 -0
- package/locales/it-IT/providers.json +80 -0
- package/locales/ja-JP/common.json +1 -1
- package/locales/ja-JP/discover.json +204 -0
- package/locales/ja-JP/metadata.json +20 -3
- package/locales/ja-JP/models.json +845 -0
- package/locales/ja-JP/providers.json +80 -0
- package/locales/ko-KR/common.json +1 -1
- package/locales/ko-KR/discover.json +204 -0
- package/locales/ko-KR/metadata.json +20 -3
- package/locales/ko-KR/models.json +845 -0
- package/locales/ko-KR/providers.json +80 -0
- package/locales/nl-NL/common.json +1 -1
- package/locales/nl-NL/discover.json +204 -0
- package/locales/nl-NL/metadata.json +20 -3
- package/locales/nl-NL/models.json +845 -0
- package/locales/nl-NL/providers.json +80 -0
- package/locales/pl-PL/common.json +1 -1
- package/locales/pl-PL/discover.json +204 -0
- package/locales/pl-PL/metadata.json +20 -3
- package/locales/pl-PL/models.json +845 -0
- package/locales/pl-PL/providers.json +80 -0
- package/locales/pt-BR/common.json +1 -1
- package/locales/pt-BR/discover.json +204 -0
- package/locales/pt-BR/metadata.json +20 -3
- package/locales/pt-BR/models.json +845 -0
- package/locales/pt-BR/providers.json +80 -0
- package/locales/ru-RU/common.json +1 -1
- package/locales/ru-RU/discover.json +204 -0
- package/locales/ru-RU/metadata.json +20 -3
- package/locales/ru-RU/models.json +845 -0
- package/locales/ru-RU/providers.json +80 -0
- package/locales/tr-TR/common.json +1 -1
- package/locales/tr-TR/discover.json +204 -0
- package/locales/tr-TR/metadata.json +20 -3
- package/locales/tr-TR/models.json +845 -0
- package/locales/tr-TR/providers.json +80 -0
- package/locales/vi-VN/common.json +1 -1
- package/locales/vi-VN/discover.json +204 -0
- package/locales/vi-VN/metadata.json +20 -3
- package/locales/vi-VN/models.json +845 -0
- package/locales/vi-VN/providers.json +80 -0
- package/locales/zh-CN/common.json +1 -1
- package/locales/zh-CN/discover.json +204 -0
- package/locales/zh-CN/metadata.json +20 -3
- package/locales/zh-CN/models.json +845 -0
- package/locales/zh-CN/providers.json +80 -0
- package/locales/zh-CN/welcome.json +1 -1
- package/locales/zh-TW/common.json +1 -1
- package/locales/zh-TW/discover.json +204 -0
- package/locales/zh-TW/metadata.json +20 -3
- package/locales/zh-TW/models.json +845 -0
- package/locales/zh-TW/providers.json +80 -0
- package/package.json +3 -2
- package/src/app/(main)/@nav/_layout/Desktop/TopActions.test.tsx +3 -3
- package/src/app/(main)/@nav/_layout/Desktop/TopActions.tsx +3 -3
- package/src/app/(main)/@nav/_layout/Mobile.tsx +3 -3
- package/src/app/(main)/_layout/Mobile.tsx +9 -1
- package/src/app/(main)/discover/(detail)/_layout/Desktop.tsx +24 -0
- package/src/app/(main)/discover/(detail)/_layout/Mobile/Header.tsx +25 -0
- package/src/app/(main)/discover/(detail)/_layout/Mobile/index.tsx +17 -0
- package/src/app/(main)/discover/(detail)/assistant/[slug]/features/Actions.tsx +35 -0
- package/src/app/(main)/discover/(detail)/assistant/[slug]/features/AddAgent.tsx +86 -0
- package/src/app/(main)/discover/(detail)/assistant/[slug]/features/ConversationExample/TopicList.tsx +74 -0
- package/src/app/(main)/discover/(detail)/assistant/[slug]/features/ConversationExample/index.tsx +100 -0
- package/src/app/(main)/discover/(detail)/assistant/[slug]/features/Header.tsx +118 -0
- package/src/app/(main)/discover/(detail)/assistant/[slug]/features/InfoSidebar/SuggestionItem.tsx +62 -0
- package/src/app/(main)/discover/(detail)/assistant/[slug]/features/InfoSidebar/ToolItem.tsx +19 -0
- package/src/app/(main)/discover/(detail)/assistant/[slug]/features/InfoSidebar/index.tsx +64 -0
- package/src/app/(main)/discover/(detail)/assistant/[slug]/features/SystemRole.tsx +35 -0
- package/src/app/(main)/discover/(detail)/assistant/[slug]/features/Temp.tsx +44 -0
- package/src/app/(main)/discover/(detail)/assistant/[slug]/page.tsx +121 -0
- package/src/app/(main)/discover/(detail)/error.tsx +5 -0
- package/src/app/(main)/discover/(detail)/features/Back.tsx +42 -0
- package/src/app/(main)/discover/(detail)/features/Block.tsx +50 -0
- package/src/app/(main)/discover/(detail)/features/DetailLayout.tsx +91 -0
- package/src/app/(main)/discover/(detail)/features/HighlightBlock.tsx +82 -0
- package/src/app/(main)/discover/(detail)/features/ShareButton.tsx +160 -0
- package/src/app/(main)/discover/(detail)/features/SidebarContainer.tsx +19 -0
- package/src/app/(main)/discover/(detail)/layout.tsx +12 -0
- package/src/app/(main)/discover/(detail)/loading.tsx +38 -0
- package/src/app/(main)/discover/(detail)/model/[...slugs]/features/Actions.tsx +46 -0
- package/src/app/(main)/discover/(detail)/model/[...slugs]/features/ChatWithModel.tsx +93 -0
- package/src/app/(main)/discover/(detail)/model/[...slugs]/features/Header.tsx +85 -0
- package/src/app/(main)/discover/(detail)/model/[...slugs]/features/InfoSidebar/SuggestionItem.tsx +75 -0
- package/src/app/(main)/discover/(detail)/model/[...slugs]/features/InfoSidebar/index.tsx +49 -0
- package/src/app/(main)/discover/(detail)/model/[...slugs]/features/ParameterList/ParameterItem.tsx +71 -0
- package/src/app/(main)/discover/(detail)/model/[...slugs]/features/ParameterList/index.tsx +110 -0
- package/src/app/(main)/discover/(detail)/model/[...slugs]/features/ProviderList/ProviderItem.tsx +152 -0
- package/src/app/(main)/discover/(detail)/model/[...slugs]/features/ProviderList/index.tsx +45 -0
- package/src/app/(main)/discover/(detail)/model/[...slugs]/page.tsx +114 -0
- package/src/app/(main)/discover/(detail)/not-found.tsx +3 -0
- package/src/app/(main)/discover/(detail)/plugin/[slug]/features/Actions.tsx +35 -0
- package/src/app/(main)/discover/(detail)/plugin/[slug]/features/Header.tsx +114 -0
- package/src/app/(main)/discover/(detail)/plugin/[slug]/features/InfoSidebar/SuggestionItem.tsx +62 -0
- package/src/app/(main)/discover/(detail)/plugin/[slug]/features/InfoSidebar/index.tsx +49 -0
- package/src/app/(main)/discover/(detail)/plugin/[slug]/features/InstallPlugin.tsx +87 -0
- package/src/app/(main)/discover/(detail)/plugin/[slug]/features/ParameterList.tsx +95 -0
- package/src/app/(main)/discover/(detail)/plugin/[slug]/features/Schema.tsx +23 -0
- package/src/app/(main)/discover/(detail)/plugin/[slug]/page.tsx +103 -0
- package/src/app/(main)/discover/(detail)/provider/[slug]/features/Actions.tsx +49 -0
- package/src/app/(main)/discover/(detail)/provider/[slug]/features/Header.tsx +73 -0
- package/src/app/(main)/discover/(detail)/provider/[slug]/features/InfoSidebar/SuggestionItem.tsx +75 -0
- package/src/app/(main)/discover/(detail)/provider/[slug]/features/InfoSidebar/index.tsx +49 -0
- package/src/app/(main)/discover/(detail)/provider/[slug]/features/ModelList/ModelItem.tsx +148 -0
- package/src/app/(main)/discover/(detail)/provider/[slug]/features/ModelList/index.tsx +60 -0
- package/src/app/(main)/discover/(detail)/provider/[slug]/features/ProviderConfig.tsx +80 -0
- package/src/app/(main)/discover/(detail)/provider/[slug]/page.tsx +116 -0
- package/src/app/(main)/discover/(list)/(home)/Client.tsx +42 -0
- package/src/app/(main)/discover/(list)/(home)/features/AssistantList.tsx +33 -0
- package/src/app/(main)/discover/(list)/(home)/features/ModelList.tsx +22 -0
- package/src/app/(main)/discover/(list)/(home)/features/PluginList.tsx +25 -0
- package/src/app/(main)/discover/(list)/(home)/loading.tsx +1 -0
- package/src/app/(main)/discover/(list)/(home)/page.tsx +54 -0
- package/src/app/(main)/discover/(list)/_layout/Desktop/Nav.tsx +118 -0
- package/src/app/(main)/discover/(list)/_layout/Desktop/index.tsx +37 -0
- package/src/app/(main)/discover/(list)/_layout/Desktop/useScroll.ts +33 -0
- package/src/app/(main)/discover/(list)/_layout/Mobile/Header.tsx +62 -0
- package/src/app/(main)/discover/(list)/_layout/Mobile/Nav.tsx +94 -0
- package/src/app/(main)/discover/(list)/_layout/Mobile/index.tsx +27 -0
- package/src/app/(main)/discover/(list)/assistants/[slug]/page.tsx +64 -0
- package/src/app/(main)/discover/(list)/assistants/_layout/Desktop.tsx +22 -0
- package/src/app/(main)/discover/(list)/assistants/_layout/Mobile.tsx +9 -0
- package/src/app/(main)/discover/(list)/assistants/features/Card.tsx +176 -0
- package/src/app/(main)/discover/(list)/assistants/features/Category.tsx +48 -0
- package/src/app/(main)/discover/(list)/assistants/features/List.tsx +97 -0
- package/src/app/(main)/discover/(list)/assistants/features/useCategory.tsx +116 -0
- package/src/app/(main)/discover/(list)/assistants/layout.tsx +12 -0
- package/src/app/(main)/discover/(list)/assistants/loading.tsx +1 -0
- package/src/app/(main)/discover/(list)/assistants/page.tsx +51 -0
- package/src/app/(main)/discover/(list)/error.tsx +5 -0
- package/src/app/(main)/{market → discover/(list)}/layout.tsx +4 -3
- package/src/app/(main)/discover/(list)/loading.tsx +39 -0
- package/src/app/(main)/discover/(list)/models/[slug]/page.tsx +70 -0
- package/src/app/(main)/discover/(list)/models/_layout/Desktop.tsx +28 -0
- package/src/app/(main)/discover/(list)/models/_layout/Mobile.tsx +9 -0
- package/src/app/(main)/discover/(list)/models/features/Card.tsx +116 -0
- package/src/app/(main)/discover/(list)/models/features/Category.tsx +67 -0
- package/src/app/(main)/discover/(list)/models/features/List.tsx +72 -0
- package/src/app/(main)/discover/(list)/models/features/const.ts +9 -0
- package/src/app/(main)/discover/(list)/models/layout.tsx +12 -0
- package/src/app/(main)/discover/(list)/models/loading.tsx +1 -0
- package/src/app/(main)/discover/(list)/models/page.tsx +61 -0
- package/src/app/(main)/discover/(list)/not-found.tsx +3 -0
- package/src/app/(main)/discover/(list)/plugins/[slug]/page.tsx +64 -0
- package/src/app/(main)/discover/(list)/plugins/_layout/Desktop.tsx +22 -0
- package/src/app/(main)/discover/(list)/plugins/_layout/Mobile.tsx +9 -0
- package/src/app/(main)/discover/(list)/plugins/features/Card.tsx +154 -0
- package/src/app/(main)/discover/(list)/plugins/features/Category.tsx +45 -0
- package/src/app/(main)/discover/(list)/plugins/features/List.tsx +96 -0
- package/src/app/(main)/discover/(list)/plugins/features/useCategory.tsx +80 -0
- package/src/app/(main)/discover/(list)/plugins/layout.tsx +12 -0
- package/src/app/(main)/discover/(list)/plugins/loading.tsx +1 -0
- package/src/app/(main)/discover/(list)/plugins/page.tsx +52 -0
- package/src/app/(main)/discover/(list)/providers/features/Card.tsx +117 -0
- package/src/app/(main)/discover/(list)/providers/features/List.tsx +71 -0
- package/src/app/(main)/discover/(list)/providers/loading.tsx +1 -0
- package/src/app/(main)/discover/(list)/providers/page.tsx +52 -0
- package/src/app/(main)/discover/_layout/Desktop/Header.tsx +36 -0
- package/src/app/(main)/discover/_layout/Desktop/index.tsx +21 -0
- package/src/app/(main)/discover/_layout/Mobile/index.tsx +9 -0
- package/src/app/(main)/{market/features/AgentCard/AgentCardBanner.tsx → discover/components/CardBanner.tsx} +5 -5
- package/src/app/(main)/discover/components/CategoryContainer.tsx +18 -0
- package/src/app/(main)/discover/components/CategoryMenu.tsx +39 -0
- package/src/app/(main)/discover/components/GitHubAvatar.tsx +19 -0
- package/src/app/(main)/discover/components/GridLoadingCard.tsx +69 -0
- package/src/app/(main)/discover/components/ListLoading.tsx +66 -0
- package/src/app/(main)/discover/components/Loading.tsx +17 -0
- package/src/app/(main)/discover/components/SearchResultCount.tsx +37 -0
- package/src/app/(main)/discover/components/Statistic.tsx +92 -0
- package/src/app/(main)/discover/components/Title.tsx +76 -0
- package/src/app/(main)/discover/components/VirtuosoGridList/index.tsx +52 -0
- package/src/app/(main)/discover/components/VirtuosoGridList/useScrollParent.ts +19 -0
- package/src/app/(main)/discover/error.tsx +5 -0
- package/src/app/(main)/{market/features/ShareAgentButton → discover/features/CreateButton}/Inner.tsx +9 -10
- package/src/app/(main)/{market/features/ShareAgentButton → discover/features/CreateButton}/index.tsx +9 -9
- package/src/app/(main)/discover/features/LikeButton.tsx +73 -0
- package/src/app/(main)/discover/features/ModelFeatureTags.tsx +77 -0
- package/src/app/(main)/discover/features/StoreSearchBar.tsx +84 -0
- package/src/app/(main)/discover/features/const.ts +2 -0
- package/src/app/(main)/discover/features/useNav.tsx +71 -0
- package/src/app/(main)/discover/layout.tsx +12 -0
- package/src/app/(main)/discover/loading.tsx +9 -0
- package/src/app/(main)/discover/not-found.tsx +3 -0
- package/src/app/(main)/discover/search/_layout/Desktop.tsx +42 -0
- package/src/app/(main)/discover/search/_layout/Mobile/Header.tsx +31 -0
- package/src/app/(main)/discover/search/_layout/Mobile/Nav.tsx +56 -0
- package/src/app/(main)/discover/search/_layout/Mobile/index.tsx +32 -0
- package/src/app/(main)/discover/search/features/AssistantsResult.tsx +27 -0
- package/src/app/(main)/discover/search/features/Category.tsx +41 -0
- package/src/app/(main)/discover/search/features/ModelsResult.tsx +27 -0
- package/src/app/(main)/discover/search/features/PluginsResult.tsx +27 -0
- package/src/app/(main)/discover/search/features/ProvidersResult.tsx +26 -0
- package/src/app/(main)/discover/search/layout.tsx +12 -0
- package/src/app/(main)/discover/search/loading.tsx +1 -0
- package/src/app/(main)/discover/search/page.tsx +78 -0
- package/src/app/(main)/settings/llm/components/ProviderConfig/index.tsx +0 -6
- package/src/app/(main)/welcome/features/Actions.tsx +1 -1
- package/src/app/@modal/(.)discover/assistant/[slug]/page.tsx +1 -0
- package/src/app/@modal/(.)discover/layout.tsx +29 -0
- package/src/app/@modal/(.)discover/loading.tsx +3 -0
- package/src/app/@modal/(.)discover/model/[...slugs]/page.tsx +1 -0
- package/src/app/@modal/(.)discover/plugin/[slug]/page.tsx +1 -0
- package/src/app/@modal/(.)discover/provider/[slug]/page.tsx +1 -0
- package/src/app/@modal/features/InterceptingContext.tsx +9 -0
- package/src/app/@modal/layout.tsx +58 -21
- package/src/app/api/{market → assistant}/[id]/route.ts +2 -3
- package/src/app/api/{market → assistant/store}/route.ts +2 -5
- package/src/app/api/plugin/store/route.ts +1 -4
- package/src/app/metadata.ts +3 -0
- package/src/app/redirect/page.tsx +15 -0
- package/src/components/FetchErrorNotification/Description.tsx +2 -0
- package/src/components/InterceptingLink/index.tsx +27 -0
- package/src/components/mdx/CodeBlock.tsx +46 -0
- package/src/components/mdx/Link.tsx +21 -0
- package/src/components/mdx/index.tsx +51 -0
- package/src/const/discover.ts +63 -1
- package/src/features/Conversation/Error/PluginSettings.tsx +1 -1
- package/src/features/Conversation/Messages/Tool/Inspector/Settings.tsx +1 -1
- package/src/features/Conversation/components/InboxWelcome/AgentsSuggest.tsx +41 -24
- package/src/features/MobileTabBar/index.tsx +3 -3
- package/src/features/PluginDetailModal/APIs.tsx +1 -1
- package/src/features/PluginDevModal/UrlManifestForm.tsx +1 -1
- package/src/features/PluginStore/PluginItem/Action.tsx +1 -1
- package/src/features/PluginsUI/Render/DefaultType/index.tsx +1 -1
- package/src/features/PluginsUI/Render/StandaloneType/index.tsx +1 -1
- package/src/hooks/useInterceptingRoutes.ts +21 -1
- package/src/hooks/useShare.tsx +191 -0
- package/src/locales/create.ts +1 -1
- package/src/locales/default/common.ts +1 -1
- package/src/locales/default/discover.ts +205 -0
- package/src/locales/default/index.ts +6 -2
- package/src/locales/default/metadata.ts +23 -3
- package/src/locales/default/models.ts +15 -0
- package/src/locales/default/providers.ts +15 -0
- package/src/locales/default/welcome.ts +1 -1
- package/src/locales/resources.ts +2 -0
- package/src/server/ld.ts +85 -11
- package/src/server/metadata.ts +41 -3
- package/src/{app/api/market/AgentMarket.test.ts → server/modules/AssistantStore/index.test.ts} +15 -15
- package/src/{app/api/market/AgentMarket.ts → server/modules/AssistantStore/index.ts} +7 -3
- package/src/{app/api/plugin/store/Store.test.ts → server/modules/PluginStore/index.test.ts} +1 -1
- package/src/server/services/discover/index.ts +352 -0
- package/src/server/services/doc/index.tsx +40 -0
- package/src/server/translation.ts +11 -5
- package/src/services/__tests__/__snapshots__/tool.test.ts.snap +1 -1
- package/src/services/{_auth.test.ts → __tests__/_auth.test.ts} +1 -1
- package/src/services/__tests__/assistant.test.ts +82 -0
- package/src/services/__tests__/tool.test.ts +13 -13
- package/src/services/_url.ts +2 -2
- package/src/services/assistant.ts +30 -0
- package/src/services/chat.ts +1 -1
- package/src/services/tool.ts +7 -129
- package/src/store/chat/slices/plugin/action.test.ts +112 -0
- package/src/store/chat/slices/plugin/action.ts +1 -3
- package/src/store/global/initialState.ts +1 -1
- package/src/store/tool/selectors/tool.test.ts +1 -1
- package/src/store/tool/slices/customPlugin/action.test.ts +1 -1
- package/src/store/tool/slices/customPlugin/action.ts +1 -1
- package/src/store/tool/slices/plugin/action.ts +1 -1
- package/src/store/tool/slices/plugin/selectors.test.ts +3 -3
- package/src/store/tool/slices/plugin/selectors.ts +3 -3
- package/src/store/tool/slices/store/action.test.ts +16 -22
- package/src/store/tool/slices/store/action.ts +8 -8
- package/src/types/discover.ts +152 -0
- package/src/types/llm.ts +4 -2
- package/src/types/meta.ts +1 -0
- package/src/utils/format.test.ts +191 -112
- package/src/utils/format.ts +36 -0
- package/src/utils/toolManifest.ts +124 -0
- package/src/app/(main)/market/@detail/default.tsx +0 -12
- package/src/app/(main)/market/@detail/features/AgentDetailContent.tsx +0 -73
- package/src/app/(main)/market/@detail/features/Banner.tsx +0 -46
- package/src/app/(main)/market/@detail/features/Comment.tsx +0 -16
- package/src/app/(main)/market/@detail/features/Header.tsx +0 -81
- package/src/app/(main)/market/@detail/features/Loading.tsx +0 -63
- package/src/app/(main)/market/@detail/features/TokenTag.tsx +0 -27
- package/src/app/(main)/market/@detail/features/style.ts +0 -32
- package/src/app/(main)/market/_layout/Desktop/DetailSidebar.tsx +0 -84
- package/src/app/(main)/market/_layout/Desktop/Header.tsx +0 -29
- package/src/app/(main)/market/_layout/Desktop/Hero.tsx +0 -40
- package/src/app/(main)/market/_layout/Desktop/index.tsx +0 -46
- package/src/app/(main)/market/_layout/Mobile/DetailModal.tsx +0 -32
- package/src/app/(main)/market/_layout/Mobile/Header.tsx +0 -20
- package/src/app/(main)/market/_layout/Mobile/index.tsx +0 -25
- package/src/app/(main)/market/_layout/type.ts +0 -6
- package/src/app/(main)/market/features/AgentCard/index.tsx +0 -139
- package/src/app/(main)/market/features/AgentList.tsx +0 -103
- package/src/app/(main)/market/features/AgentSearchBar.tsx +0 -42
- package/src/app/(main)/market/features/TagList.tsx +0 -69
- package/src/app/(main)/market/loading.tsx +0 -15
- package/src/app/(main)/market/page.tsx +0 -44
- package/src/const/market.ts +0 -15
- package/src/locales/default/market.ts +0 -32
- package/src/services/market.ts +0 -22
- package/src/store/market/action.ts +0 -82
- package/src/store/market/index.ts +0 -3
- package/src/store/market/initialState.ts +0 -19
- package/src/store/market/selectors.ts +0 -38
- package/src/store/market/store.ts +0 -48
- package/src/types/market.ts +0 -20
- /package/src/{app/api/plugin/store/Store.ts → server/modules/PluginStore/index.ts} +0 -0
@@ -0,0 +1,87 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import { App, Button, Skeleton } from 'antd';
|
4
|
+
import { createStyles } from 'antd-style';
|
5
|
+
import { memo, useState } from 'react';
|
6
|
+
import { useTranslation } from 'react-i18next';
|
7
|
+
|
8
|
+
import { useToolStore } from '@/store/tool';
|
9
|
+
import { pluginSelectors, pluginStoreSelectors } from '@/store/tool/selectors';
|
10
|
+
|
11
|
+
const useStyles = createStyles(({ css }) => ({
|
12
|
+
button: css`
|
13
|
+
button {
|
14
|
+
width: 100%;
|
15
|
+
}
|
16
|
+
`,
|
17
|
+
}));
|
18
|
+
|
19
|
+
const InstallPlugin = memo<{ identifier: string }>(({ identifier }) => {
|
20
|
+
const { styles } = useStyles();
|
21
|
+
const { t } = useTranslation(['discover', 'plugin']);
|
22
|
+
const [loading, setLoading] = useState(false);
|
23
|
+
const { modal } = App.useApp();
|
24
|
+
const [
|
25
|
+
useFetchPluginStore,
|
26
|
+
useFetchInstalledPlugins,
|
27
|
+
installed,
|
28
|
+
installing,
|
29
|
+
installPlugin,
|
30
|
+
unInstallPlugin,
|
31
|
+
] = useToolStore((s) => [
|
32
|
+
s.useFetchPluginStore,
|
33
|
+
s.useFetchInstalledPlugins,
|
34
|
+
pluginSelectors.isPluginInstalled(identifier)(s),
|
35
|
+
pluginStoreSelectors.isPluginInstallLoading(identifier)(s),
|
36
|
+
s.installPlugin,
|
37
|
+
s.uninstallPlugin,
|
38
|
+
]);
|
39
|
+
|
40
|
+
const { isLoading } = useFetchPluginStore();
|
41
|
+
const { isLoading: installedPluginLoading } = useFetchInstalledPlugins();
|
42
|
+
const loadingState = installedPluginLoading || loading;
|
43
|
+
|
44
|
+
const handleInstall = async () => {
|
45
|
+
setLoading(true);
|
46
|
+
await installPlugin(identifier);
|
47
|
+
setLoading(false);
|
48
|
+
};
|
49
|
+
|
50
|
+
const handleUninstall = async () => {
|
51
|
+
modal.confirm({
|
52
|
+
centered: true,
|
53
|
+
okButtonProps: { danger: true },
|
54
|
+
onOk: async () => {
|
55
|
+
setLoading(true);
|
56
|
+
await unInstallPlugin(identifier);
|
57
|
+
setLoading(false);
|
58
|
+
},
|
59
|
+
title: t('store.actions.confirmUninstall', { ns: 'plugin' }),
|
60
|
+
type: 'error',
|
61
|
+
});
|
62
|
+
};
|
63
|
+
|
64
|
+
if (isLoading) return <Skeleton.Button block size={'large'} />;
|
65
|
+
|
66
|
+
return (
|
67
|
+
<Button
|
68
|
+
className={styles.button}
|
69
|
+
loading={loadingState}
|
70
|
+
onClick={() => {
|
71
|
+
if (loading || installing) return;
|
72
|
+
if (installed) {
|
73
|
+
handleUninstall();
|
74
|
+
} else {
|
75
|
+
handleInstall();
|
76
|
+
}
|
77
|
+
}}
|
78
|
+
size={'large'}
|
79
|
+
style={{ flex: 1, width: 'unset' }}
|
80
|
+
type={installed ? 'default' : 'primary'}
|
81
|
+
>
|
82
|
+
{t(installed ? 'plugins.installed' : 'plugins.install')}
|
83
|
+
</Button>
|
84
|
+
);
|
85
|
+
});
|
86
|
+
|
87
|
+
export default InstallPlugin;
|
@@ -0,0 +1,95 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import { TabsNav, Tag } from '@lobehub/ui';
|
4
|
+
import { Empty, Skeleton, Table } from 'antd';
|
5
|
+
import { useTheme } from 'antd-style';
|
6
|
+
import { PuzzleIcon } from 'lucide-react';
|
7
|
+
import { memo, useState } from 'react';
|
8
|
+
import { useTranslation } from 'react-i18next';
|
9
|
+
import { Flexbox, FlexboxProps } from 'react-layout-kit';
|
10
|
+
|
11
|
+
import { DiscoverPlugintem } from '@/types/discover';
|
12
|
+
|
13
|
+
import HighlightBlock from '../../../features/HighlightBlock';
|
14
|
+
|
15
|
+
interface ParameterListProps extends FlexboxProps {
|
16
|
+
data?: DiscoverPlugintem;
|
17
|
+
}
|
18
|
+
|
19
|
+
const ParameterList = memo<ParameterListProps>(({ data }) => {
|
20
|
+
const { t } = useTranslation('discover');
|
21
|
+
const [active, setActive] = useState<number>(0);
|
22
|
+
const theme = useTheme();
|
23
|
+
if (!data) return <Skeleton active />;
|
24
|
+
|
25
|
+
let content;
|
26
|
+
|
27
|
+
if (!data.manifest?.api) {
|
28
|
+
content = <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />;
|
29
|
+
} else {
|
30
|
+
const api = data.manifest?.api;
|
31
|
+
const parameters = Object.entries(api[active]?.parameters?.properties || {}).map(
|
32
|
+
([key, value]) => ({
|
33
|
+
name: key,
|
34
|
+
type: value.type,
|
35
|
+
}),
|
36
|
+
);
|
37
|
+
|
38
|
+
content = (
|
39
|
+
<>
|
40
|
+
<TabsNav
|
41
|
+
activeKey={active as any}
|
42
|
+
items={api.map((item, index) => ({
|
43
|
+
key: index as any,
|
44
|
+
label: item.name,
|
45
|
+
}))}
|
46
|
+
onChange={(key) => setActive(key as any)}
|
47
|
+
variant={'compact'}
|
48
|
+
/>
|
49
|
+
<Flexbox
|
50
|
+
padding={16}
|
51
|
+
style={{
|
52
|
+
border: `1px solid ${theme.colorBorderSecondary}`,
|
53
|
+
borderRadius: theme.borderRadiusLG,
|
54
|
+
}}
|
55
|
+
>
|
56
|
+
{api[active].description}
|
57
|
+
</Flexbox>
|
58
|
+
<Table
|
59
|
+
bordered
|
60
|
+
columns={[
|
61
|
+
{
|
62
|
+
dataIndex: 'name',
|
63
|
+
render: (name: string) => <code>{name}</code>,
|
64
|
+
title: t('plugins.meta.parameter'),
|
65
|
+
},
|
66
|
+
{
|
67
|
+
dataIndex: 'type',
|
68
|
+
render: (type: string) => <Tag>{type.toUpperCase()}</Tag>,
|
69
|
+
title: t('plugins.meta.type'),
|
70
|
+
},
|
71
|
+
]}
|
72
|
+
dataSource={parameters}
|
73
|
+
pagination={false}
|
74
|
+
rowKey={'name'}
|
75
|
+
tableLayout="fixed"
|
76
|
+
/>
|
77
|
+
</>
|
78
|
+
);
|
79
|
+
}
|
80
|
+
|
81
|
+
return (
|
82
|
+
<HighlightBlock
|
83
|
+
avatar={data?.meta?.avatar}
|
84
|
+
icon={PuzzleIcon}
|
85
|
+
style={{ background: theme.colorBgContainer }}
|
86
|
+
title={t('plugins.meta.title')}
|
87
|
+
>
|
88
|
+
<Flexbox gap={24} padding={16} width={'100%'}>
|
89
|
+
{content}
|
90
|
+
</Flexbox>
|
91
|
+
</HighlightBlock>
|
92
|
+
);
|
93
|
+
});
|
94
|
+
|
95
|
+
export default ParameterList;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import { Highlighter } from '@lobehub/ui';
|
4
|
+
import { Skeleton } from 'antd';
|
5
|
+
import { memo } from 'react';
|
6
|
+
|
7
|
+
import Block from '../../../features/Block';
|
8
|
+
|
9
|
+
const Schema = memo<{ children?: string }>(({ children }) => {
|
10
|
+
return (
|
11
|
+
<Block title={'JSON Schema'}>
|
12
|
+
{children ? (
|
13
|
+
<Highlighter allowChangeLanguage={false} fullFeatured language={'json'}>
|
14
|
+
{children}
|
15
|
+
</Highlighter>
|
16
|
+
) : (
|
17
|
+
<Skeleton paragraph={{ rows: 4 }} title={false} />
|
18
|
+
)}
|
19
|
+
</Block>
|
20
|
+
);
|
21
|
+
});
|
22
|
+
|
23
|
+
export default Schema;
|
@@ -0,0 +1,103 @@
|
|
1
|
+
import { notFound } from 'next/navigation';
|
2
|
+
import urlJoin from 'url-join';
|
3
|
+
|
4
|
+
import StructuredData from '@/components/StructuredData';
|
5
|
+
import { Locales } from '@/locales/resources';
|
6
|
+
import { ldModule } from '@/server/ld';
|
7
|
+
import { metadataModule } from '@/server/metadata';
|
8
|
+
import { DiscoverService } from '@/server/services/discover';
|
9
|
+
import { translation } from '@/server/translation';
|
10
|
+
import { isMobileDevice } from '@/utils/responsive';
|
11
|
+
|
12
|
+
import DetailLayout from '../../features/DetailLayout';
|
13
|
+
import Actions from './features/Actions';
|
14
|
+
import Header from './features/Header';
|
15
|
+
import InfoSidebar from './features/InfoSidebar';
|
16
|
+
import ParameterList from './features/ParameterList';
|
17
|
+
import Schema from './features/Schema';
|
18
|
+
|
19
|
+
type Props = { params: { slug: string }; searchParams: { hl?: Locales } };
|
20
|
+
|
21
|
+
export const generateMetadata = async ({ params, searchParams }: Props) => {
|
22
|
+
const { slug: identifier } = params;
|
23
|
+
const { t, locale } = await translation('metadata', searchParams?.hl);
|
24
|
+
|
25
|
+
const discoverService = new DiscoverService();
|
26
|
+
const data = await discoverService.getPluginById(locale, identifier);
|
27
|
+
if (!data) return notFound();
|
28
|
+
|
29
|
+
const { meta, createdAt, homepage, author } = data;
|
30
|
+
|
31
|
+
return {
|
32
|
+
authors: [
|
33
|
+
{ name: author, url: homepage },
|
34
|
+
{ name: 'LobeHub', url: 'https://github.com/lobehub' },
|
35
|
+
{ name: 'LobeChat', url: 'https://github.com/lobehub/lobe-chat' },
|
36
|
+
],
|
37
|
+
keywords: meta.tags,
|
38
|
+
webpage: {
|
39
|
+
enable: true,
|
40
|
+
search: '/discover/search',
|
41
|
+
},
|
42
|
+
...metadataModule.generate({
|
43
|
+
alternate: true,
|
44
|
+
description: meta.description,
|
45
|
+
locale,
|
46
|
+
tags: meta.tags,
|
47
|
+
title: [meta.title, t('discover.plugins.title')].join(' · '),
|
48
|
+
url: urlJoin('/discover/plugin', identifier),
|
49
|
+
}),
|
50
|
+
other: {
|
51
|
+
'article:author': author,
|
52
|
+
'article:published_time': createdAt
|
53
|
+
? new Date(createdAt).toISOString()
|
54
|
+
: new Date().toISOString(),
|
55
|
+
'robots': 'index,follow,max-image-preview:large',
|
56
|
+
},
|
57
|
+
};
|
58
|
+
};
|
59
|
+
|
60
|
+
const Page = async ({ params, searchParams }: Props) => {
|
61
|
+
const { slug: identifier } = params;
|
62
|
+
const { t, locale } = await translation('metadata', searchParams?.hl);
|
63
|
+
const mobile = isMobileDevice();
|
64
|
+
|
65
|
+
const discoverService = new DiscoverService();
|
66
|
+
const data = await discoverService.getPluginById(locale, identifier, true);
|
67
|
+
if (!data) return notFound();
|
68
|
+
|
69
|
+
const { meta, createdAt, author } = data;
|
70
|
+
const ld = ldModule.generate({
|
71
|
+
article: {
|
72
|
+
author: [author],
|
73
|
+
enable: true,
|
74
|
+
identifier,
|
75
|
+
tags: meta.tags,
|
76
|
+
},
|
77
|
+
date: createdAt ? new Date(createdAt).toISOString() : new Date().toISOString(),
|
78
|
+
description: meta.description || t('discover.plugins.description'),
|
79
|
+
title: [meta.title, t('discover.plugins.title')].join(' · '),
|
80
|
+
url: urlJoin('/discover/plugin', identifier),
|
81
|
+
});
|
82
|
+
|
83
|
+
return (
|
84
|
+
<>
|
85
|
+
<StructuredData ld={ld} />
|
86
|
+
<DetailLayout
|
87
|
+
actions={<Actions data={data} identifier={identifier} />}
|
88
|
+
header={<Header data={data} identifier={identifier} mobile={mobile} />}
|
89
|
+
mobile={mobile}
|
90
|
+
sidebar={<InfoSidebar data={data} identifier={identifier} mobile={mobile} />}
|
91
|
+
/* ↓ cloud slot ↓ */
|
92
|
+
/* ↑ cloud slot ↑ */
|
93
|
+
>
|
94
|
+
<ParameterList data={data} />
|
95
|
+
<Schema>{JSON.stringify(data.manifest.api, null, 2)}</Schema>
|
96
|
+
</DetailLayout>
|
97
|
+
</>
|
98
|
+
);
|
99
|
+
};
|
100
|
+
|
101
|
+
Page.DisplayName = 'DiscoverToolsDetail';
|
102
|
+
|
103
|
+
export default Page;
|
@@ -0,0 +1,49 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import { ModelTag, ProviderIcon } from '@lobehub/icons';
|
4
|
+
import { Tag } from '@lobehub/ui';
|
5
|
+
import { memo } from 'react';
|
6
|
+
import { useTranslation } from 'react-i18next';
|
7
|
+
import { Flexbox, FlexboxProps } from 'react-layout-kit';
|
8
|
+
import urlJoin from 'url-join';
|
9
|
+
|
10
|
+
import { OFFICIAL_URL } from '@/const/url';
|
11
|
+
import { DiscoverProviderItem } from '@/types/discover';
|
12
|
+
|
13
|
+
import ShareButton from '../../../features/ShareButton';
|
14
|
+
import ProviderConfig from './ProviderConfig';
|
15
|
+
|
16
|
+
interface ModelActionsProps extends FlexboxProps {
|
17
|
+
data: DiscoverProviderItem;
|
18
|
+
identifier: string;
|
19
|
+
}
|
20
|
+
|
21
|
+
const ProviderActions = memo<ModelActionsProps>(({ identifier, data }) => {
|
22
|
+
const { t } = useTranslation('providers');
|
23
|
+
return (
|
24
|
+
<Flexbox align={'center'} gap={8} horizontal width={'100%'}>
|
25
|
+
<ProviderConfig data={data} identifier={identifier} />
|
26
|
+
<ShareButton
|
27
|
+
meta={{
|
28
|
+
avatar: <ProviderIcon provider={identifier} size={64} type={'avatar'} />,
|
29
|
+
desc: data.meta.description && t(`${identifier}.description`),
|
30
|
+
tags: (
|
31
|
+
<Flexbox align={'center'} gap={4} horizontal justify={'center'} wrap={'wrap'}>
|
32
|
+
{data.models
|
33
|
+
.slice(0, 4)
|
34
|
+
.filter(Boolean)
|
35
|
+
.map((tag: string, index) => (
|
36
|
+
<ModelTag key={index} model={tag} style={{ margin: 0 }} />
|
37
|
+
))}
|
38
|
+
{data.models.length > 3 && <Tag>+{data.models.length - 3}</Tag>}
|
39
|
+
</Flexbox>
|
40
|
+
),
|
41
|
+
title: data.meta.title,
|
42
|
+
url: urlJoin(OFFICIAL_URL, '/discover/provider', identifier),
|
43
|
+
}}
|
44
|
+
/>
|
45
|
+
</Flexbox>
|
46
|
+
);
|
47
|
+
});
|
48
|
+
|
49
|
+
export default ProviderActions;
|
@@ -0,0 +1,73 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import { ProviderCombine } from '@lobehub/icons';
|
4
|
+
import { Button } from 'antd';
|
5
|
+
import { createStyles } from 'antd-style';
|
6
|
+
import Link from 'next/link';
|
7
|
+
import { memo } from 'react';
|
8
|
+
import { useTranslation } from 'react-i18next';
|
9
|
+
import { Flexbox } from 'react-layout-kit';
|
10
|
+
|
11
|
+
import { DiscoverProviderItem } from '@/types/discover';
|
12
|
+
|
13
|
+
import Back from '../../../features/Back';
|
14
|
+
|
15
|
+
export const useStyles = createStyles(({ css, token }) => ({
|
16
|
+
tag: css`
|
17
|
+
color: ${token.colorTextSecondary};
|
18
|
+
background: ${token.colorFillSecondary};
|
19
|
+
border: none;
|
20
|
+
`,
|
21
|
+
time: css`
|
22
|
+
font-size: 12px;
|
23
|
+
color: ${token.colorTextDescription};
|
24
|
+
`,
|
25
|
+
title: css`
|
26
|
+
margin-block: 0;
|
27
|
+
font-size: 18px;
|
28
|
+
font-weight: bold;
|
29
|
+
line-height: 1.2;
|
30
|
+
`,
|
31
|
+
}));
|
32
|
+
|
33
|
+
interface HeaderProps {
|
34
|
+
data: DiscoverProviderItem;
|
35
|
+
identifier: string;
|
36
|
+
mobile?: boolean;
|
37
|
+
}
|
38
|
+
|
39
|
+
const Header = memo<HeaderProps>(({ identifier, data, mobile }) => {
|
40
|
+
const { styles, theme } = useStyles();
|
41
|
+
const { t } = useTranslation(['discover', 'providers']);
|
42
|
+
|
43
|
+
return (
|
44
|
+
<Flexbox gap={12} width={'100%'}>
|
45
|
+
{!mobile && <Back href={'/discover/providers'} />}
|
46
|
+
<Flexbox align={'center'} gap={8} horizontal justify={'space-between'} width={'100%'}>
|
47
|
+
<Flexbox align={'flex-start'} gap={4} justify={'flex-start'}>
|
48
|
+
<ProviderCombine provider={identifier} size={40} />
|
49
|
+
<Flexbox gap={8} horizontal>
|
50
|
+
<Link href={data.meta.url} target={'_blank'}>
|
51
|
+
@{data.meta.title}
|
52
|
+
</Link>
|
53
|
+
<div style={{ color: theme.colorTextDescription }}>
|
54
|
+
{t('providers.modelCount', { count: data.models.length })}
|
55
|
+
</div>
|
56
|
+
</Flexbox>
|
57
|
+
</Flexbox>
|
58
|
+
{!mobile && (
|
59
|
+
<Flexbox align={'center'} gap={4} horizontal justify={'flex-end'}>
|
60
|
+
<Link href={'/discover/providers'}>
|
61
|
+
<Button className={styles.tag} shape={'round'} size={'small'}>
|
62
|
+
{t('tab.providers')}
|
63
|
+
</Button>
|
64
|
+
</Link>
|
65
|
+
</Flexbox>
|
66
|
+
)}
|
67
|
+
</Flexbox>
|
68
|
+
{data.meta.description && <div> {t(`${identifier}.description`, { ns: 'providers' })}</div>}
|
69
|
+
</Flexbox>
|
70
|
+
);
|
71
|
+
});
|
72
|
+
|
73
|
+
export default Header;
|
package/src/app/(main)/discover/(detail)/provider/[slug]/features/InfoSidebar/SuggestionItem.tsx
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
import { ProviderCombine } from '@lobehub/icons';
|
2
|
+
import { Typography } from 'antd';
|
3
|
+
import { createStyles } from 'antd-style';
|
4
|
+
import { memo } from 'react';
|
5
|
+
import { useTranslation } from 'react-i18next';
|
6
|
+
import { Flexbox, FlexboxProps } from 'react-layout-kit';
|
7
|
+
|
8
|
+
import { DiscoverProviderItem } from '@/types/discover';
|
9
|
+
|
10
|
+
const { Paragraph } = Typography;
|
11
|
+
|
12
|
+
const useStyles = createStyles(({ css, token, isDarkMode }) => ({
|
13
|
+
banner: css`
|
14
|
+
opacity: ${isDarkMode ? 0.9 : 0.4};
|
15
|
+
`,
|
16
|
+
container: css`
|
17
|
+
cursor: pointer;
|
18
|
+
|
19
|
+
position: relative;
|
20
|
+
|
21
|
+
overflow: hidden;
|
22
|
+
|
23
|
+
height: 100%;
|
24
|
+
|
25
|
+
color: ${token.colorText};
|
26
|
+
`,
|
27
|
+
desc: css`
|
28
|
+
margin-block-end: 0 !important;
|
29
|
+
color: ${token.colorTextDescription};
|
30
|
+
`,
|
31
|
+
id: css`
|
32
|
+
margin-block-end: 0 !important;
|
33
|
+
font-size: 12px;
|
34
|
+
color: ${token.colorTextSecondary};
|
35
|
+
`,
|
36
|
+
title: css`
|
37
|
+
margin-block-end: 0 !important;
|
38
|
+
font-size: 16px !important;
|
39
|
+
font-weight: 500 !important;
|
40
|
+
`,
|
41
|
+
token: css`
|
42
|
+
font-family: ${token.fontFamilyCode};
|
43
|
+
`,
|
44
|
+
}));
|
45
|
+
|
46
|
+
export interface SuggestionItemProps
|
47
|
+
extends Omit<DiscoverProviderItem, 'suggestions' | 'socialData'>,
|
48
|
+
FlexboxProps {}
|
49
|
+
|
50
|
+
const SuggestionItem = memo<SuggestionItemProps>(
|
51
|
+
({ className, meta, identifier, models, ...rest }) => {
|
52
|
+
const { title, description } = meta;
|
53
|
+
const { t } = useTranslation(['discover', 'providers']);
|
54
|
+
const { cx, styles, theme } = useStyles();
|
55
|
+
|
56
|
+
return (
|
57
|
+
<Flexbox className={cx(styles.container, className)} gap={12} key={identifier} {...rest}>
|
58
|
+
<ProviderCombine provider={identifier} size={24} title={title} />
|
59
|
+
<Flexbox gap={8} horizontal style={{ fontSize: 12, marginTop: -8 }}>
|
60
|
+
<div style={{ color: theme.colorTextSecondary }}>@{meta.title}</div>
|
61
|
+
<div style={{ color: theme.colorTextDescription }}>
|
62
|
+
{t('providers.modelCount', { count: models.length })}
|
63
|
+
</div>
|
64
|
+
</Flexbox>
|
65
|
+
{description && (
|
66
|
+
<Paragraph className={styles.desc} ellipsis={{ rows: 2 }}>
|
67
|
+
{t(`${identifier}.description`, { ns: 'providers' })}
|
68
|
+
</Paragraph>
|
69
|
+
)}
|
70
|
+
</Flexbox>
|
71
|
+
);
|
72
|
+
},
|
73
|
+
);
|
74
|
+
|
75
|
+
export default SuggestionItem;
|
@@ -0,0 +1,49 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import { Skeleton } from 'antd';
|
4
|
+
import { memo } from 'react';
|
5
|
+
import { useTranslation } from 'react-i18next';
|
6
|
+
import { Flexbox, FlexboxProps } from 'react-layout-kit';
|
7
|
+
import urlJoin from 'url-join';
|
8
|
+
|
9
|
+
import InterceptingLink from '@/components/InterceptingLink';
|
10
|
+
import { DiscoverProviderItem } from '@/types/discover';
|
11
|
+
|
12
|
+
import Block from '../../../../features/Block';
|
13
|
+
import SuggestionItem from './SuggestionItem';
|
14
|
+
|
15
|
+
interface InfoSidebarProps extends FlexboxProps {
|
16
|
+
data: DiscoverProviderItem;
|
17
|
+
identifier: string;
|
18
|
+
mobile?: boolean;
|
19
|
+
}
|
20
|
+
|
21
|
+
const InfoSidebar = memo<InfoSidebarProps>(({ data, ...rest }) => {
|
22
|
+
const { t } = useTranslation('discover');
|
23
|
+
|
24
|
+
return (
|
25
|
+
<Flexbox gap={48} style={{ position: 'relative' }} width={'100%'} {...rest}>
|
26
|
+
<Block
|
27
|
+
gap={24}
|
28
|
+
more={t('providers.more')}
|
29
|
+
moreLink={'/discover/providers'}
|
30
|
+
title={t('providers.suggestions')}
|
31
|
+
>
|
32
|
+
{data?.suggestions?.length > 0 ? (
|
33
|
+
data?.suggestions.map((item) => (
|
34
|
+
<InterceptingLink
|
35
|
+
href={urlJoin('/discover/provider', item.identifier)}
|
36
|
+
key={item.identifier}
|
37
|
+
>
|
38
|
+
<SuggestionItem {...item} />
|
39
|
+
</InterceptingLink>
|
40
|
+
))
|
41
|
+
) : (
|
42
|
+
<Skeleton active paragraph={{ rows: 5 }} title={false} />
|
43
|
+
)}
|
44
|
+
</Block>
|
45
|
+
</Flexbox>
|
46
|
+
);
|
47
|
+
});
|
48
|
+
|
49
|
+
export default InfoSidebar;
|