@finos/legend-application-marketplace
Version:
Legend Marketplace application core
70 lines • 5.87 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
/**
* Copyright (c) 2025-present, Goldman Sachs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useCallback, useState } from 'react';
import { observer } from 'mobx-react-lite';
import { AnalyticsIcon, ArrowLeftIcon, CaretRightIcon, PsychologyIcon, RobotOutlineIcon, SparkleStarsIcon, } from '@finos/legend-art';
import { Container, Typography } from '@mui/material';
import { LegendMarketplacePage } from '../LegendMarketplacePage.js';
import { LegendMarketplaceAIChatStoreProvider } from '../../application/providers/LegendMarketplaceAIChatStoreProvider.js';
import { MarketplaceAIChatView } from './MarketplaceAIChatView.js';
import { LegendMarketplaceSearchBar } from '../../components/SearchBar/LegendMarketplaceSearchBar.js';
import { useLegendMarketplaceBaseStore } from '../../application/providers/LegendMarketplaceFrameworkProvider.js';
import { ComingSoonDisplay } from '../../components/ComingSoon/ComingSoonDisplay.js';
const AGENT_DESCRIPTION = 'Ask questions about your data, discover data products, and run queries using natural language.';
const AgentCardsView = observer((props) => {
const { onSelectAgent } = props;
const legendMarketplaceBaseStore = useLegendMarketplaceBaseStore();
const applicationStore = legendMarketplaceBaseStore.applicationStore;
const isDarkMode = !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled;
return (_jsxs(_Fragment, { children: [_jsx(Container, { className: "marketplace-agents__search-container", children: _jsx(LegendMarketplaceSearchBar, { onSearch: onSelectAgent, placeholder: "Ask a question about your data...", className: "marketplace-agents__search-bar", enableAutosuggest: false }) }), _jsx("div", { className: "marketplace-agents__section-bar", children: _jsx("div", { className: "marketplace-agents__section-bar__container", children: _jsx(Typography, { variant: "h4", className: "marketplace-agents__section-title", children: "Intelligence & AI Agents" }) }) }), _jsx(Container, { maxWidth: "xxxl", className: "marketplace-agents__content-container", children: _jsx("div", { className: "marketplace-agents__cards", children: _jsxs("button", { type: "button", className: "marketplace-agents__agent-card", onClick: () => onSelectAgent(), children: [_jsx("div", { className: "marketplace-agents__agent-card-icon", children: _jsx("img", { src: isDarkMode
? '/assets/legendmarketplacehomelogodark.png'
: '/assets/legendmarketplacehomelogolight.png', alt: "Legend Marketplace AI", className: "marketplace-agents__agent-card-logo" }) }), _jsxs("div", { className: "marketplace-agents__agent-card-content", children: [_jsx("h3", { className: "marketplace-agents__agent-card-title", children: "Legend Marketplace AI" }), _jsx("p", { className: "marketplace-agents__agent-card-desc", children: AGENT_DESCRIPTION })] }), _jsxs("div", { className: "marketplace-agents__agent-card-action", children: ["Launch Agent ", _jsx(CaretRightIcon, {})] })] }) }) })] }));
});
export const LegendMarketplaceAgents = observer(() => {
const legendMarketplaceBaseStore = useLegendMarketplaceBaseStore();
const applicationStore = legendMarketplaceBaseStore.applicationStore;
const showDevFeatures = applicationStore.config.options.showDevFeatures;
const [showChat, setShowChat] = useState(false);
const [initialQuery, setInitialQuery] = useState(undefined);
const handleSelectAgent = useCallback((query) => {
setInitialQuery(query);
setShowChat(true);
}, []);
if (!showDevFeatures) {
const featuresPreviewItems = [
{
icon: _jsx(SparkleStarsIcon, {}),
title: 'Smart Recommendations',
},
{
icon: _jsx(AnalyticsIcon, {}),
title: 'Data Analysis',
},
{
icon: _jsx(PsychologyIcon, {}),
title: 'Intelligent Insights',
},
];
return (_jsx(LegendMarketplacePage, { className: "agents-coming-soon", children: _jsx(ComingSoonDisplay, { loadingIcon: _jsx(RobotOutlineIcon, {}), title: "Legend Intelligence", description: "Transform your data operations with intelligent AI agents that learn, adapt, and deliver autonomous insights. Experience the future of data-driven automation and decision-making excellence.", featuresPreviewItems: featuresPreviewItems }) }));
}
const initialQueryProp = initialQuery === undefined ? {} : { initialQuery };
return (_jsx(LegendMarketplacePage, { className: "legend-marketplace-ai-page", children: showChat ? (_jsx(LegendMarketplaceAIChatStoreProvider, { children: _jsxs("div", { className: "marketplace-agents__chat-wrapper", children: [_jsxs("button", { type: "button", className: "marketplace-agents__back-btn", onClick: () => {
setShowChat(false);
setInitialQuery(undefined);
}, children: [_jsx(ArrowLeftIcon, {}), _jsx("span", { children: "Back to Agents" })] }), _jsx(MarketplaceAIChatView, { ...initialQueryProp })] }) })) : (_jsx(AgentCardsView, { onSelectAgent: handleSelectAgent })) }));
});
//# sourceMappingURL=LegendMarketplaceAgents.js.map