import * as React from 'react'; import Box from '@mui/material/Box'; import Button from '@mui/material/Button'; import Card from '@mui/material/Card'; import MuiChip from '@mui/material/Chip'; import Container from '@mui/material/Container'; import Typography from '@mui/material/Typography'; import { styled } from '@mui/material/styles'; import DevicesRoundedIcon from '@mui/icons-material/DevicesRounded'; import EdgesensorHighRoundedIcon from '@mui/icons-material/EdgesensorHighRounded'; import ViewQuiltRoundedIcon from '@mui/icons-material/ViewQuiltRounded'; const items = [ { icon: , title: 'Dashboard', description: 'This item could provide a snapshot of the most important metrics or data points related to the product.', imageLight: `url("${import.meta.env.TEMPLATE_IMAGE_URL || 'https://mui.com'}/static/images/templates/templates-images/dash-light.png")`, imageDark: `url("${import.meta.env.TEMPLATE_IMAGE_URL || 'https://mui.com'}/static/images/templates/templates-images/dash-dark.png")`, }, { icon: , title: 'Mobile integration', description: 'This item could provide information about the mobile app version of the product.', imageLight: `url("${import.meta.env.TEMPLATE_IMAGE_URL || 'https://mui.com'}/static/images/templates/templates-images/mobile-light.png")`, imageDark: `url("${import.meta.env.TEMPLATE_IMAGE_URL || 'https://mui.com'}/static/images/templates/templates-images/mobile-dark.png")`, }, { icon: , title: 'Available on all platforms', description: 'This item could let users know the product is available on all platforms, such as web, mobile, and desktop.', imageLight: `url("${import.meta.env.TEMPLATE_IMAGE_URL || 'https://mui.com'}/static/images/templates/templates-images/devices-light.png")`, imageDark: `url("${import.meta.env.TEMPLATE_IMAGE_URL || 'https://mui.com'}/static/images/templates/templates-images/devices-dark.png")`, }, ]; const Chip = styled(MuiChip)(({ theme }) => ({ variants: [ { props: ({ selected }) => !!selected, style: { background: 'linear-gradient(to bottom right, hsl(210, 98%, 48%), hsl(210, 98%, 35%))', color: 'hsl(0, 0%, 100%)', borderColor: (theme.vars || theme).palette.primary.light, '& .MuiChip-label': { color: 'hsl(0, 0%, 100%)', }, ...theme.applyStyles('dark', { borderColor: (theme.vars || theme).palette.primary.dark, }), }, }, ], })); export function MobileLayout({ selectedItemIndex, handleItemClick, selectedFeature, }) { if (!items[selectedItemIndex]) { return null; } return ( {items.map(({ title }, index) => ( handleItemClick(index)} selected={selectedItemIndex === index} /> ))} ({ mb: 2, backgroundSize: 'cover', backgroundPosition: 'center', minHeight: 280, backgroundImage: 'var(--items-imageLight)', ...theme.applyStyles('dark', { backgroundImage: 'var(--items-imageDark)', }), })} style={ items[selectedItemIndex] ? ({ '--items-imageLight': items[selectedItemIndex].imageLight, '--items-imageDark': items[selectedItemIndex].imageDark, }) : {} } /> {selectedFeature.title} {selectedFeature.description} ); } export default function Features() { const [selectedItemIndex, setSelectedItemIndex] = React.useState(0); const handleItemClick = (index) => { setSelectedItemIndex(index); }; const selectedFeature = items[selectedItemIndex]; return ( Product features Provide a brief overview of the key features of the product. For example, you could list the number of features, their types or benefits, and add-ons.
{items.map(({ icon, title, description }, index) => ( handleItemClick(index)} sx={[ (theme) => ({ p: 2, height: '100%', width: '100%', '&:hover': { backgroundColor: (theme.vars || theme).palette.action.hover, }, }), selectedItemIndex === index && { backgroundColor: 'action.selected', }, ]} > {icon} {title} {description} ))}
({ m: 'auto', width: 420, height: 500, backgroundSize: 'contain', backgroundImage: 'var(--items-imageLight)', ...theme.applyStyles('dark', { backgroundImage: 'var(--items-imageDark)', }), })} style={ items[selectedItemIndex] ? ({ '--items-imageLight': items[selectedItemIndex].imageLight, '--items-imageDark': items[selectedItemIndex].imageDark, }) : {} } />
); }