move helpers out of app folder

This commit is contained in:
Nate Kelley 2025-02-19 19:39:03 -07:00
parent d01b28ffeb
commit b057d80828
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
7 changed files with 9 additions and 10 deletions

View File

@ -1,6 +1,6 @@
import React, { useLayoutEffect, useMemo, useRef } from 'react';
import { Modal, Button, Divider, Input, InputRef } from 'antd';
import { AppMaterialIcons, AppSegmented, Text } from '@/components';
import { AppMaterialIcons, AppSegmented, asset_typeToIcon, Text } from '@/components';
import { BusterList, BusterListColumn, BusterListRow } from '@/components/list';
import { useMemoizedFn, useThrottleFn } from 'ahooks';
import { boldHighlights, formatDate } from '@/utils';
@ -9,7 +9,6 @@ import {
type BusterSearchResult,
ShareAssetType
} from '@/api/asset_interfaces';
import { asset_typeToIcon } from '@/app/app/_helpers';
import { CircleSpinnerLoaderContainer } from '@/components/loaders';
import { BusterCollection } from '@/api/asset_interfaces';
import { useBusterSearchContextSelector } from '@/context/Search';
@ -76,7 +75,7 @@ export const AddTypeModal: React.FC<{
title: 'Name',
dataIndex: 'name',
render: (_, record: BusterSearchResult) => {
const { name, updated_at, type, highlights } = record;
const { name, type, highlights } = record;
const icon = asset_typeToIcon(type, {
size: 17
});

View File

@ -1 +0,0 @@
export * from './listHelpers';

View File

@ -0,0 +1 @@
export * from './listIconHelpers';

View File

@ -1,5 +1,5 @@
import { ShareAssetType } from '@/api/asset_interfaces';
import { AppMaterialIcons } from '@/components/icons';
import {AppMaterialIcons} from '../AppMaterialIcons'
const iconRecord: Record<ShareAssetType, string> = {
[ShareAssetType.COLLECTION]: 'note_stack',

View File

@ -1 +1,2 @@
export * from './AppMaterialIcons';
export * from './helpers';

View File

@ -1,21 +1,20 @@
'use client';
import React from 'react';
import { ShareAssetType } from '@/api/asset_interfaces';
import { asset_typeToTranslation } from '@/app/app/_helpers';
import { BusterLogo } from '@/assets/svg/BusterLogo';
import { asset_typeToTranslation } from '@/components/icons';
import { Title } from '@/components/text';
import { useBusterNotifications } from '@/context/BusterNotifications';
import { BusterRoutes, createBusterRoute } from '@/routes';
import { Button } from 'antd';
import Link from 'next/link';
import React from 'react';
export const AppNoPageAccess: React.FC<{
asset_type: ShareAssetType;
metricId?: string;
dashboardId?: string;
}> = React.memo(({ asset_type, metricId, dashboardId }) => {
}> = React.memo(({ asset_type }) => {
const { openInfoMessage } = useBusterNotifications();
return (

View File

@ -8,8 +8,8 @@ import Link from 'next/link';
import { useParams } from 'next/navigation';
import React, { useMemo, useState } from 'react';
import isEmpty from 'lodash/isEmpty';
import { asset_typeToIcon } from '@/app/app/_helpers';
import { useMemoizedFn } from 'ahooks';
import { asset_typeToIcon } from '@/components/icons';
export const FavoritesDropdown: React.FC<{}> = React.memo(() => {
const userFavorites = useUserConfigContextSelector((state) => state.userFavorites);