import { useState } from 'react' import { Box, Paper, Tabs, Tab, styled, useTheme, Fade…
- User
import { useState } from 'react' import { Box, Paper, Tabs, Tab, styled, useTheme, Fade } from '@mui/material' import { Assessment, ShowChart, CompareArrows, TrendingDown } from '@mui/icons-material'
import PortfolioOverview from './results/PortfolioOverview' import AttributionAnalysis from './results/AttributionAnalysis' import DrawdownAnalysis from './results/DrawdownAnalysis' import RebalancingAnalysis from './results/RebalancingAnalysis'
const ResultsContainer = styled(Box)(({ theme }) => ({ display: 'flex', flexDirection: 'column', gap: theme.spacing(2), height: '100%', overflow: 'hidden', // Prevent double scrollbars }))
const TabsContainer = styled(Paper)(({ theme }) => ({ borderRadius: '12px 12px 0 0', background: theme.palette.mode === 'light' ? 'linear-gradient(to right, rgba(25, 118, 210, 0.05), rgba(25, 118, 210, 0.1))' : 'linear-gradient(to right, rgba(144, 202, 249, 0.05), rgba(144, 202, 249, 0.08))', borderBottom:
1px solid ${theme.palette.divider}, }))const ContentContainer = styled(Box)(({ theme }) => ({ flex: 1, overflow: 'auto', // Enable scrolling for content borderRadius: '0 0 12px 12px', padding: theme.spacing(2), [theme.breakpoints.up('sm')]: { padding: theme.spacing(3), }, background: theme.palette.mode === 'light' ? 'rgba(255, 255, 255, 0.8)' : 'rgba(18, 18, 18, 0.8)', backdropFilter: 'blur(10px)', border:
1px solid ${theme.palette.divider}, borderTop: 'none', }))const StyledTab = styled(Tab)(({ theme }) => ({ minHeight: 64, textTransform: 'none', fontSize: '0.9rem', fontWeight: 500, '&.Mui-selected': { color: theme.palette.primary.main, }, }))
function ResultsSection({ results, comparisonPortfolios, onRemoveComparison }) { const [activeTab, setActiveTab] = useState(0) const theme = useTheme()
if (!results) return null
const handleTabChange = (event, newValue) => { setActiveTab(newValue) }
const tabs = [ { label: 'Overview', icon: , component: PortfolioOverview }, { label: 'Attribution', icon: , component: AttributionAnalysis }, { label: 'Drawdowns', icon: , component: DrawdownAnalysis }, { label: 'Rebalancing', icon: , component: RebalancingAnalysis } ]
const ActiveComponent = tabs[activeTab].component
return ( <Tabs value={activeTab} onChange={handleTabChange} variant="scrollable" scrollButtons="auto" sx={{ px: 2, '& .MuiTabs-indicator': { height: 3, borderRadius: '3px 3px 0 0', }, }} > {tabs.map((tab, index) => ( ))}
<ContentContainer> <ActiveComponent results={results} comparisonPortfolios={comparisonPortfolios} onRemoveComparison={onRemoveComparison} /> </ContentContainer> </ResultsContainer> </Fade>) }
export default ResultsSection
update the above code into below and return me full updated code: import { Box, Paper, Typography, Tabs, Tab, Alert, Fade, Chip, Stack, Divider, useTheme } from '@mui/material' import { useState } from 'react' import PortfolioOverview from './results/PortfolioOverview' import CorrelationAnalysis from './results/CorrelationAnalysis' import RebalancingAnalysis from './results/RebalancingAnalysis' import DrawdownAnalysis from './results/DrawdownAnalysis' import AttributionAnalysis from './results/AttributionAnalysis' import CompareIcon from '@mui/icons-material/Compare' import TimelineIcon from '@mui/icons-material/Timeline' import BarChartIcon from '@mui/icons-material/BarChart' import ShowChartIcon from '@mui/icons-material/ShowChart' import TrendingDownIcon from '@mui/icons-material/TrendingDown' import AssessmentIcon from '@mui/icons-material/Assessment' import { formatDate } from '../utils'
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.