Refactor: removed default exports.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { useContext } from 'react';
|
||||
import { FormRow } from 'react-basics';
|
||||
import { parseDateRange } from '@/lib/date';
|
||||
import DateFilter from '@/components/input/DateFilter';
|
||||
import WebsiteSelect from '@/components/input/WebsiteSelect';
|
||||
import { DateFilter } from '@/components/input/DateFilter';
|
||||
import { WebsiteSelect } from '@/components/input/WebsiteSelect';
|
||||
import { useMessages, useTeamUrl, useWebsite } from '@/components/hooks';
|
||||
import { ReportContext } from './Report';
|
||||
import styles from './BaseParameters.module.css';
|
||||
@@ -63,5 +63,3 @@ export function BaseParameters({
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default BaseParameters;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useState } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
import { REPORT_PARAMETERS } from '@/lib/constants';
|
||||
import PopupForm from './PopupForm';
|
||||
import FieldSelectForm from './FieldSelectForm';
|
||||
import { PopupForm } from './PopupForm';
|
||||
import { FieldSelectForm } from './FieldSelectForm';
|
||||
|
||||
export function FieldAddForm({
|
||||
fields = [],
|
||||
@@ -45,5 +45,3 @@ export function FieldAddForm({
|
||||
document.body,
|
||||
);
|
||||
}
|
||||
|
||||
export default FieldAddForm;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Form, FormRow, Menu, Item } from 'react-basics';
|
||||
import { useMessages } from '@/components/hooks';
|
||||
|
||||
export default function FieldAggregateForm({
|
||||
export function FieldAggregateForm({
|
||||
name,
|
||||
type,
|
||||
onSelect,
|
||||
|
||||
@@ -33,7 +33,7 @@ export interface FieldFilterFormProps {
|
||||
isNew?: boolean;
|
||||
}
|
||||
|
||||
export default function FieldFilterEditForm({
|
||||
export function FieldFilterEditForm({
|
||||
websiteId,
|
||||
name,
|
||||
label,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useFields, useMessages } from '@/components/hooks';
|
||||
import Icons from '@/components/icons';
|
||||
import { Icons } from '@/components/icons';
|
||||
import { useContext } from 'react';
|
||||
import { Button, FormRow, Icon, Popup, PopupTrigger } from 'react-basics';
|
||||
import FieldSelectForm from '../[reportId]/FieldSelectForm';
|
||||
@@ -59,5 +59,3 @@ export function FieldParameters() {
|
||||
</FormRow>
|
||||
);
|
||||
}
|
||||
|
||||
export default FieldParameters;
|
||||
|
||||
@@ -9,11 +9,7 @@ export interface FieldSelectFormProps {
|
||||
showType?: boolean;
|
||||
}
|
||||
|
||||
export default function FieldSelectForm({
|
||||
fields = [],
|
||||
onSelect,
|
||||
showType = true,
|
||||
}: FieldSelectFormProps) {
|
||||
export function FieldSelectForm({ fields = [], onSelect, showType = true }: FieldSelectFormProps) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useContext } from 'react';
|
||||
import { useMessages, useFormat, useFilters, useFields } from '@/components/hooks';
|
||||
import Icons from '@/components/icons';
|
||||
import { Icons } from '@/components/icons';
|
||||
import { Button, FormRow, Icon, Popup, PopupTrigger } from 'react-basics';
|
||||
import FilterSelectForm from '../[reportId]/FilterSelectForm';
|
||||
import ParameterList from '../[reportId]/ParameterList';
|
||||
@@ -134,5 +134,3 @@ const FilterParameter = ({
|
||||
</PopupTrigger>
|
||||
);
|
||||
};
|
||||
|
||||
export default FilterParameters;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useState } from 'react';
|
||||
import FieldSelectForm from './FieldSelectForm';
|
||||
import FieldFilterEditForm from './FieldFilterEditForm';
|
||||
import { FieldSelectForm } from './FieldSelectForm';
|
||||
import { FieldFilterEditForm } from './FieldFilterEditForm';
|
||||
|
||||
export interface FilterSelectFormProps {
|
||||
websiteId?: string;
|
||||
@@ -11,7 +11,7 @@ export interface FilterSelectFormProps {
|
||||
allowFilterSelect?: boolean;
|
||||
}
|
||||
|
||||
export default function FilterSelectForm({
|
||||
export function FilterSelectForm({
|
||||
websiteId,
|
||||
fields,
|
||||
startDate,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ReactNode } from 'react';
|
||||
import { Icon } from 'react-basics';
|
||||
import Icons from '@/components/icons';
|
||||
import Empty from '@/components/common/Empty';
|
||||
import { Icons } from '@/components/icons';
|
||||
import { Empty } from '@/components/common/Empty';
|
||||
import { useMessages } from '@/components/hooks';
|
||||
import styles from './ParameterList.module.css';
|
||||
import classNames from 'classnames';
|
||||
@@ -46,5 +46,3 @@ const Item = ({
|
||||
};
|
||||
|
||||
ParameterList.Item = Item;
|
||||
|
||||
export default ParameterList;
|
||||
|
||||
@@ -21,5 +21,3 @@ export function PopupForm({
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default PopupForm;
|
||||
|
||||
@@ -29,5 +29,3 @@ export function Report({
|
||||
</ReportContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
export default Report;
|
||||
|
||||
@@ -11,5 +11,3 @@ export function ReportBody({ children }) {
|
||||
|
||||
return <div className={styles.body}>{children}</div>;
|
||||
}
|
||||
|
||||
export default ReportBody;
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useMessages, useApi, useNavigation, useTeamUrl } from '@/components/hoo
|
||||
import { ReportContext } from './Report';
|
||||
import styles from './ReportHeader.module.css';
|
||||
import { REPORT_TYPES } from '@/lib/constants';
|
||||
import Breadcrumb from '@/components/common/Breadcrumb';
|
||||
import { Breadcrumb } from '@/components/common/Breadcrumb';
|
||||
|
||||
export function ReportHeader({ icon }) {
|
||||
const { report, updateReport } = useContext(ReportContext);
|
||||
@@ -102,5 +102,3 @@ export function ReportHeader({ icon }) {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default ReportHeader;
|
||||
|
||||
@@ -23,5 +23,3 @@ export function ReportMenu({ children }) {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default ReportMenu;
|
||||
|
||||
@@ -20,7 +20,7 @@ const reports = {
|
||||
revenue: RevenueReport,
|
||||
};
|
||||
|
||||
export default function ReportPage({ reportId }: { reportId: string }) {
|
||||
export function ReportPage({ reportId }: { reportId: string }) {
|
||||
const { report } = useReport(reportId);
|
||||
|
||||
if (!report) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Metadata } from 'next';
|
||||
import ReportPage from './ReportPage';
|
||||
import { ReportPage } from './ReportPage';
|
||||
|
||||
export default async function ({ params }: { params: { reportId: string } }) {
|
||||
const { reportId } = await params;
|
||||
|
||||
Reference in New Issue
Block a user