diff --git a/Composer/packages/client/src/components/GetStarted/GetStarted.tsx b/Composer/packages/client/src/components/GetStarted/GetStarted.tsx index db86ce1c53..a588be6e93 100644 --- a/Composer/packages/client/src/components/GetStarted/GetStarted.tsx +++ b/Composer/packages/client/src/components/GetStarted/GetStarted.tsx @@ -3,7 +3,7 @@ /** @jsx jsx */ import { jsx } from '@emotion/react'; -import React from 'react'; +import React, { useState, useCallback } from 'react'; import formatMessage from 'format-message'; import { Panel, IPanelStyles, PanelType } from '@fluentui/react/lib/Panel'; import { Pivot, PivotItem } from '@fluentui/react/lib/Pivot'; @@ -22,29 +22,57 @@ type GetStartedProps = { onBotReady: () => void; }; -const panelStyles = { +const panelStyles: Partial = { root: { marginTop: 50, }, -} as IPanelStyles; +}; + +enum GetStartedTab { + GetStarted = 'GetStarted', + LearnMore = 'LearnMore', +} + +interface ActiveTabContentProps { + activeTab: GetStartedTab; + tabProps: GetStartedProps; +} + +const ActiveTabContent: React.FC = ({ activeTab, tabProps }) => { + switch (activeTab) { + case GetStartedTab.GetStarted: + return ; + case GetStartedTab.LearnMore: { + const { projectId, onDismiss } = tabProps; + return ; + } + default: + return null; + } +}; export const GetStarted: React.FC = (props) => { - const { projectId, onDismiss } = props; + const [activeTab, setActiveTab] = useState(GetStartedTab.GetStarted); + + const handleLinkClick = useCallback((item?: PivotItem) => { + if (item) { + setActiveTab(item.props.itemKey as GetStartedTab); + } + }, []); - const renderTabs = () => { + const renderTabs = useCallback(() => { return ( - - - - - - - + + + ); - }; + }, []); return ( = (props) => { type={PanelType.custom} onDismiss={props.onDismiss} onRenderHeader={renderTabs} - /> + > + + ); };