Skip to content

Commit a1943fa

Browse files
committed
chore: fix file path
1 parent aefc704 commit a1943fa

6 files changed

Lines changed: 15 additions & 5 deletions

File tree

apps/pro/src/app/blocks/[category]/category-page-client.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { CategoryNav } from '@/components/layout/category-nav';
44
import { BlockPreview } from '@/components/block-preview';
5-
import { getCategory } from '../../../lib/blocks';
5+
import { getCategory } from '../../../utils/blocks';
66
import styles from './category-page.module.scss';
77

88
interface CategoryPageClientProps {

apps/pro/src/app/blocks/[category]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { notFound } from 'next/navigation';
2-
import { getCategorySlugs, getCategoryInfo } from '../../../lib/categories';
2+
import { getCategorySlugs, getCategoryInfo } from '../../../utils/blocks';
33
import { CategoryPageClient } from './category-page-client';
44

55
export function generateStaticParams() {

apps/pro/src/app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Link from 'next/link';
2-
import { getCategories } from '../lib/categories';
2+
import { getCategories } from '../utils/blocks';
33
import styles from './page.module.scss';
44

55
const CATEGORY_ICONS: Record<string, string> = {

apps/pro/src/components/block-preview/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as TinyIcons from '@tiny-design/icons';
77
import { Toolbar, CodeIcon, CopyIcon, CheckIcon, type ViewportSize } from './toolbar';
88
import { PreviewFrame } from './preview-frame';
99
import { CodePanel } from './code-panel';
10-
import type { BlockMeta } from '../../lib/blocks';
10+
import type { BlockMeta } from '../../utils/blocks';
1111
import styles from './block-preview.module.scss';
1212

1313
// In dev mode, Next.js appends HMR code (import.meta.webpackHot...) to

apps/pro/src/components/layout/category-nav.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import Link from 'next/link';
44
import { usePathname } from 'next/navigation';
5-
import { CATEGORIES } from '../../lib/categories';
5+
import { CATEGORIES } from '../../utils/blocks';
66
import styles from './category-nav.module.scss';
77

88
export function CategoryNav() {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,13 @@ export function getCategories(): CategoryMeta[] {
152152
export function getCategory(slug: string): CategoryMeta | undefined {
153153
return CATEGORIES.find((c) => c.slug === slug);
154154
}
155+
156+
export function getCategorySlugs(): string[] {
157+
return CATEGORIES.map((c) => c.slug);
158+
}
159+
160+
export function getCategoryInfo(slug: string): { label: string; blockCount: number } | undefined {
161+
const cat = CATEGORIES.find((c) => c.slug === slug);
162+
if (!cat) return undefined;
163+
return { label: cat.label, blockCount: cat.blocks.length };
164+
}

0 commit comments

Comments
 (0)