Skip to content

Commit 84587ba

Browse files
committed
chore(lib): running biome on types
1 parent 48215ad commit 84587ba

24 files changed

Lines changed: 1619 additions & 1509 deletions
Lines changed: 59 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,72 @@
1-
import React, { ReactNode } from 'react';
2-
import { useThemeColors } from '@/lib/hooks/useThemeColors';
3-
import Icon, { IconName } from '../ui/Icon';
1+
import { useThemeColors } from "@/lib/hooks/useThemeColors";
2+
import React, { type ReactNode } from "react";
3+
import Icon, { type IconName } from "../ui/Icon";
44

55
interface EmptyStateProps {
6-
icon?: IconName;
7-
title: string;
8-
description?: string;
9-
action?: ReactNode;
10-
size?: 'sm' | 'md' | 'lg';
6+
icon?: IconName;
7+
title: string;
8+
description?: string;
9+
action?: ReactNode;
10+
size?: "sm" | "md" | "lg";
1111
}
1212

1313
export default function EmptyState({
14-
icon = 'info',
15-
title,
16-
description,
17-
action,
18-
size = 'md'
14+
icon = "info",
15+
title,
16+
description,
17+
action,
18+
size = "md",
1919
}: EmptyStateProps) {
20-
const colors = useThemeColors();
20+
const colors = useThemeColors();
2121

22-
const sizeClasses = {
23-
sm: {
24-
container: 'p-4',
25-
icon: 24,
26-
titleSize: 'text-sm',
27-
descSize: 'text-xs'
28-
},
29-
md: {
30-
container: 'p-6',
31-
icon: 36,
32-
titleSize: 'text-base',
33-
descSize: 'text-sm'
34-
},
35-
lg: {
36-
container: 'p-8',
37-
icon: 48,
38-
titleSize: 'text-lg',
39-
descSize: 'text-base'
40-
}
41-
};
22+
const sizeClasses = {
23+
sm: {
24+
container: "p-4",
25+
icon: 24,
26+
titleSize: "text-sm",
27+
descSize: "text-xs",
28+
},
29+
md: {
30+
container: "p-6",
31+
icon: 36,
32+
titleSize: "text-base",
33+
descSize: "text-sm",
34+
},
35+
lg: {
36+
container: "p-8",
37+
icon: 48,
38+
titleSize: "text-lg",
39+
descSize: "text-base",
40+
},
41+
};
4242

43-
const styles = sizeClasses[size];
43+
const styles = sizeClasses[size];
4444

45-
return (
46-
<div className={`flex flex-col items-center justify-center text-center ${styles.container}`}>
47-
<div className="mb-3" style={{ color: colors.textTertiary }}>
48-
<Icon name={icon} size={styles.icon} />
49-
</div>
45+
return (
46+
<div
47+
className={`flex flex-col items-center justify-center text-center ${styles.container}`}
48+
>
49+
<div className="mb-3" style={{ color: colors.textTertiary }}>
50+
<Icon name={icon} size={styles.icon} />
51+
</div>
5052

51-
<h3 className={`font-medium ${styles.titleSize} mb-2`} style={{ color: colors.textSecondary }}>
52-
{title}
53-
</h3>
53+
<h3
54+
className={`font-medium ${styles.titleSize} mb-2`}
55+
style={{ color: colors.textSecondary }}
56+
>
57+
{title}
58+
</h3>
5459

55-
{description && (
56-
<p className={`${styles.descSize} mb-4`} style={{ color: colors.textTertiary }}>
57-
{description}
58-
</p>
59-
)}
60+
{description && (
61+
<p
62+
className={`${styles.descSize} mb-4`}
63+
style={{ color: colors.textTertiary }}
64+
>
65+
{description}
66+
</p>
67+
)}
6068

61-
{action && (
62-
<div className="mt-2">
63-
{action}
64-
</div>
65-
)}
66-
</div>
67-
);
69+
{action && <div className="mt-2">{action}</div>}
70+
</div>
71+
);
6872
}
Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
import React, { ReactNode } from 'react';
2-
import { useThemeColors } from '@/lib/hooks/useThemeColors';
3-
import Icon from '../ui/Icon';
1+
import { useThemeColors } from "@/lib/hooks/useThemeColors";
2+
import React, { type ReactNode } from "react";
3+
import Icon from "../ui/Icon";
44

55
interface ExternalLinkProps {
6-
href: string;
7-
children: ReactNode;
8-
className?: string;
9-
iconSize?: number;
10-
networkColored?: boolean;
6+
href: string;
7+
children: ReactNode;
8+
className?: string;
9+
iconSize?: number;
10+
networkColored?: boolean;
1111
}
1212

1313
export default function ExternalLink({
14-
href,
15-
children,
16-
className = '',
17-
iconSize = 12,
18-
networkColored = true
14+
href,
15+
children,
16+
className = "",
17+
iconSize = 12,
18+
networkColored = true,
1919
}: ExternalLinkProps) {
20-
const colors = useThemeColors();
20+
const colors = useThemeColors();
2121

22-
return (
23-
<a
24-
href={href}
25-
target="_blank"
26-
rel="noopener noreferrer"
27-
className={`inline-flex items-center hover:underline transition-all duration-200 hover:translate-y-[-1px] ${className}`}
28-
style={{ color: networkColored ? colors.networkPrimary : colors.info }}
29-
>
30-
{children}
31-
<Icon name="externalLink" size={iconSize} className="ml-1" />
32-
</a>
33-
);
34-
}
22+
return (
23+
<a
24+
href={href}
25+
target="_blank"
26+
rel="noopener noreferrer"
27+
className={`inline-flex items-center hover:underline transition-all duration-200 hover:translate-y-[-1px] ${className}`}
28+
style={{ color: networkColored ? colors.networkPrimary : colors.info }}
29+
>
30+
{children}
31+
<Icon name="externalLink" size={iconSize} className="ml-1" />
32+
</a>
33+
);
34+
}

src/components/common/InfoRow.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import React, { ReactNode } from 'react';
2-
import { useThemeColors } from '@/lib/hooks/useThemeColors';
1+
import { useThemeColors } from "@/lib/hooks/useThemeColors";
2+
import React, { type ReactNode } from "react";
33

44
interface InfoRowProps {
5-
label: string;
6-
value: ReactNode;
5+
label: string;
6+
value: ReactNode;
77
}
88

99
export default function InfoRow({ label, value }: InfoRowProps) {
10-
const colors = useThemeColors();
10+
const colors = useThemeColors();
1111

12-
return (
13-
<div className="flex justify-between items-center">
14-
<span style={{ color: colors.textSecondary }}>{label}:</span>
15-
<div className="text-right">{value}</div>
16-
</div>
17-
);
18-
}
12+
return (
13+
<div className="flex justify-between items-center">
14+
<span style={{ color: colors.textSecondary }}>{label}:</span>
15+
<div className="text-right">{value}</div>
16+
</div>
17+
);
18+
}

src/components/common/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export { default as EmptyState } from './EmptyState';
2-
export { default as ExternalLink } from './ExternalLink';
3-
export { default as InfoRow } from './InfoRow';
1+
export { default as EmptyState } from "./EmptyState";
2+
export { default as ExternalLink } from "./ExternalLink";
3+
export { default as InfoRow } from "./InfoRow";
Lines changed: 53 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,67 @@
1-
'use client'
1+
"use client";
22

3-
import React, { ReactNode } from 'react'
3+
import React, { type ReactNode } from "react";
44

55
interface ContentLayoutProps {
6-
children: ReactNode
7-
sidebar?: ReactNode
8-
sidebarWidth?: 'narrow' | 'medium' | 'wide'
6+
children: ReactNode;
7+
sidebar?: ReactNode;
8+
sidebarWidth?: "narrow" | "medium" | "wide";
99
}
1010

1111
/**
1212
* Layout component for main content with optional sidebar
1313
* Makes the main content area responsive with proper spacing
1414
*/
1515
export default function ContentLayout({
16-
children,
17-
sidebar,
18-
sidebarWidth = 'medium'
19-
}: ContentLayoutProps) {
20-
const getSidebarGridCols = () => {
21-
switch (sidebarWidth) {
22-
case 'narrow': return 'lg:col-span-1 lg:grid-cols-5'
23-
case 'wide': return 'lg:col-span-2 lg:grid-cols-7'
24-
case 'medium':
25-
default: return 'lg:col-span-1 lg:grid-cols-4'
26-
}
27-
}
16+
children,
17+
sidebar,
18+
sidebarWidth = "medium",
19+
}: ContentLayoutProps) {
20+
const getSidebarGridCols = () => {
21+
switch (sidebarWidth) {
22+
case "narrow":
23+
return "lg:col-span-1 lg:grid-cols-5";
24+
case "wide":
25+
return "lg:col-span-2 lg:grid-cols-7";
26+
case "medium":
27+
default:
28+
return "lg:col-span-1 lg:grid-cols-4";
29+
}
30+
};
2831

29-
const mainContentCols = () => {
30-
switch (sidebarWidth) {
31-
case 'narrow': return 'lg:col-span-4'
32-
case 'wide': return 'lg:col-span-5'
33-
case 'medium':
34-
default: return 'lg:col-span-3'
35-
}
36-
}
32+
const mainContentCols = () => {
33+
switch (sidebarWidth) {
34+
case "narrow":
35+
return "lg:col-span-4";
36+
case "wide":
37+
return "lg:col-span-5";
38+
case "medium":
39+
default:
40+
return "lg:col-span-3";
41+
}
42+
};
3743

38-
39-
if (!sidebar) {
40-
return (
41-
<div className="container mx-auto">
42-
<div className="animate-fadeIn">
43-
{children}
44-
</div>
45-
</div>
46-
)
47-
}
44+
if (!sidebar) {
45+
return (
46+
<div className="container mx-auto">
47+
<div className="animate-fadeIn">{children}</div>
48+
</div>
49+
);
50+
}
4851

52+
return (
53+
<div className="container mx-auto">
54+
<div
55+
className={`grid grid-cols-1 lg:${getSidebarGridCols()} gap-4 lg:gap-6`}
56+
>
57+
{/* Sidebar */}
58+
<div className="col-span-1 animate-fadeIn">{sidebar}</div>
4959

50-
return (
51-
<div className="container mx-auto">
52-
<div className={`grid grid-cols-1 lg:${getSidebarGridCols()} gap-4 lg:gap-6`}>
53-
{/* Sidebar */}
54-
<div className="col-span-1 animate-fadeIn">
55-
{sidebar}
56-
</div>
57-
58-
{/* Main content */}
59-
<div className={`col-span-1 ${mainContentCols()} animate-slideInRight`}>
60-
{children}
61-
</div>
62-
</div>
63-
</div>
64-
)
65-
}
60+
{/* Main content */}
61+
<div className={`col-span-1 ${mainContentCols()} animate-slideInRight`}>
62+
{children}
63+
</div>
64+
</div>
65+
</div>
66+
);
67+
}

0 commit comments

Comments
 (0)