/** * WordPress dependencies */ import { Button } from '@wordpress/components'; import { Icon, link } from '@wordpress/icons'; /** * Internal dependencies */ import { PageHeader } from '../../components'; /** * Header summary component. * * Renders a summary of the site performance. * * @since 3.19.0 */ const HeaderSummary = (): React.JSX.Element => { return (
Today is an exceptional day.
75% more traffic than last week
Yesterday was the 33rd best Tuesday, 214th overall.
); }; /** * Type definition for the HeaderCard component. * * @since 3.19.0 */ type HeaderCardProps = { title?: string; icon?: React.JSX.Element; value?: string; change?: string; down?: boolean; className?: string; }; /** * Single stat card component. * * @since 3.19.0 * * @param {HeaderCardProps} props The component's props. */ const StatCard = ( { title, value, change, down = false, icon, className }: Readonly ): React.JSX.Element => { const changeIcon = down ? '↓' : '↑'; return (
{ title &&
{ icon && } { title }
} { value &&
{ value } { change &&
{ changeIcon }{ change }
}
}
); }; /** * Dashboard header component. * * Renders the header of the main dashboard page. * * @since 3.19.0 */ export const DashboardHeader = (): React.JSX.Element => { return (
{ [ { title: 'Page Views', value: '4.6K', change: '24%' }, { title: 'Visitors', value: '1.5K', change: '25%' }, { title: 'Minutes', value: '32', change: '40%' }, { title: 'Avg. Time', value: '32', change: '40%', down: true }, { title: 'Soc. Interactions', value: '32', change: '40%' }, { title: 'New Posts', value: '2', change: '40%' }, ].map( ( metric, index ) => ( ) ) }
); };