2022-06-25 20:49:25 -04:00
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
|
|
interface ChartBlockProps {
|
|
|
|
|
title: string;
|
|
|
|
|
legend?: React.ReactNode;
|
|
|
|
|
children: React.ReactNode;
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-05 18:10:18 -04:00
|
|
|
export default function ChartBlock({ title, legend, children }: ChartBlockProps) {
|
|
|
|
|
return (
|
2026-10-08 16:53:20 -04:00
|
|
|
<div className='group relative rounded-sm bg-popover pt-2 shadow-lg border-b-4 border-border'>
|
|
|
|
|
<div className='flex items-center justify-between px-4 py-2'>
|
|
|
|
|
<h3 className='font-header font-medium transition-colors duration-100 group-hover:text-foreground'>
|
2026-10-05 18:10:18 -04:00
|
|
|
{title}
|
|
|
|
|
</h3>
|
2026-10-08 16:53:20 -04:00
|
|
|
{legend && <p className='text-sm flex items-center'>{legend}</p>}
|
2026-10-05 18:10:18 -04:00
|
|
|
</div>
|
2026-10-08 16:53:20 -04:00
|
|
|
<div className='z-10 ml-2'>{children}</div>
|
2022-06-25 20:49:25 -04:00
|
|
|
</div>
|
2026-10-05 18:10:18 -04:00
|
|
|
);
|
|
|
|
|
}
|