- Update README.md with v0.4.0 features and screenshots placeholders - Update architecture.md with v0.4.0 implementation status - Update progress.md marking all 27 tasks as completed - Create CHANGELOG.md with complete release notes - Add v0.4.0 frontend components and hooks
40 lines
987 B
TypeScript
40 lines
987 B
TypeScript
import type { ReactNode } from 'react';
|
|
import {
|
|
ResponsiveContainer,
|
|
type ResponsiveContainerProps,
|
|
} from 'recharts';
|
|
import { cn } from '@/lib/utils';
|
|
|
|
interface ChartContainerProps extends Omit<ResponsiveContainerProps, 'children'> {
|
|
children: ReactNode;
|
|
className?: string;
|
|
title?: string;
|
|
description?: string;
|
|
}
|
|
|
|
export function ChartContainer({
|
|
children,
|
|
className,
|
|
title,
|
|
description,
|
|
...props
|
|
}: ChartContainerProps) {
|
|
return (
|
|
<div className={cn('w-full', className)}>
|
|
{(title || description) && (
|
|
<div className="mb-4">
|
|
{title && <h3 className="text-lg font-semibold">{title}</h3>}
|
|
{description && (
|
|
<p className="text-sm text-muted-foreground">{description}</p>
|
|
)}
|
|
</div>
|
|
)}
|
|
<div className="w-full overflow-hidden rounded-lg border bg-card p-4">
|
|
<ResponsiveContainer {...props}>
|
|
{children}
|
|
</ResponsiveContainer>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|