Refactor: removed default exports.

This commit is contained in:
Mike Cao 2025-02-13 22:53:25 -08:00
parent cd944e14ce
commit f83a12d6cd
343 changed files with 555 additions and 1046 deletions

View file

@ -1,5 +1,5 @@
import BarChartTooltip from '@/components/charts/BarChartTooltip';
import Chart, { ChartProps } from '@/components/charts/Chart';
import { BarChartTooltip } from '@/components/charts/BarChartTooltip';
import { Chart, ChartProps } from '@/components/charts/Chart';
import { useTheme } from '@/components/hooks';
import { renderNumberLabels } from '@/lib/charts';
import { useMemo, useState } from 'react';
@ -95,5 +95,3 @@ export function BarChart(props: BarChartProps) {
/>
);
}
export default BarChart;

View file

@ -15,7 +15,7 @@ const formats = {
year: 'yyyy',
};
export default function BarChartTooltip({ tooltip, unit, currency }) {
export function BarChartTooltip({ tooltip, unit, currency }) {
const { locale } = useLocale();
const { labelColors, dataPoints } = tooltip;

View file

@ -7,7 +7,7 @@ export interface BubbleChartProps extends ChartProps {
type?: 'bubble';
}
export default function BubbleChart(props: BubbleChartProps) {
export function BubbleChart(props: BubbleChartProps) {
const [tooltip, setTooltip] = useState(null);
const { type = 'bubble' } = props;

View file

@ -2,8 +2,8 @@ import { useState, useRef, useEffect, useMemo, ReactNode } from 'react';
import { Loading } from 'react-basics';
import classNames from 'classnames';
import ChartJS, { LegendItem, ChartOptions } from 'chart.js/auto';
import HoverTooltip from '@/components/common/HoverTooltip';
import Legend from '@/components/metrics/Legend';
import { HoverTooltip } from '@/components/common/HoverTooltip';
import { Legend } from '@/components/metrics/Legend';
import { DEFAULT_ANIMATION_DURATION } from '@/lib/constants';
import styles from './Chart.module.css';
@ -151,5 +151,3 @@ export function Chart({
</>
);
}
export default Chart;

View file

@ -7,7 +7,7 @@ export interface PieChartProps extends ChartProps {
type?: 'doughnut' | 'pie';
}
export default function PieChart(props: PieChartProps) {
export function PieChart(props: PieChartProps) {
const [tooltip, setTooltip] = useState(null);
const { type = 'pie' } = props;