2022-11-25 20:25:03 +00:00
|
|
|
import * as React from 'react';
|
2022-06-26 00:49:25 +00:00
|
|
|
import classNames from 'classnames';
|
|
|
|
import styles from '@/components/server/console/style.module.css';
|
|
|
|
|
|
|
|
interface ChartBlockProps {
|
|
|
|
title: string;
|
|
|
|
legend?: React.ReactNode;
|
|
|
|
children: React.ReactNode;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ({ title, legend, children }: ChartBlockProps) => (
|
|
|
|
<div className={classNames(styles.chart_container, 'group')}>
|
|
|
|
<div className={'flex items-center justify-between px-4 py-2'}>
|
2022-12-16 02:06:14 +00:00
|
|
|
<h3 className={'font-header transition-colors duration-100 group-hover:text-slate-50'}>{title}</h3>
|
2023-01-12 19:31:47 +00:00
|
|
|
{legend && <p className={'flex items-center text-sm'}>{legend}</p>}
|
2022-06-26 00:49:25 +00:00
|
|
|
</div>
|
2022-06-26 19:13:52 +00:00
|
|
|
<div className={'z-10 ml-2'}>{children}</div>
|
2022-06-26 00:49:25 +00:00
|
|
|
</div>
|
|
|
|
);
|