Skip to content

Commit 6143ca0

Browse files
committed
refactor: replace interface with type
1 parent 8da6676 commit 6143ca0

18 files changed

+25
-25
lines changed

resources/js/components/app-content.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { SidebarInset } from '@/components/ui/sidebar';
22
import * as React from 'react';
33

4-
interface AppContentProps extends React.ComponentProps<'div'> {
4+
type AppContentProps = React.ComponentProps<'div'> & {
55
variant?: 'header' | 'sidebar';
66
}
77

resources/js/components/app-header.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const rightNavItems: NavItem[] = [
3838

3939
const activeItemStyles = 'text-neutral-900 dark:bg-neutral-800 dark:text-neutral-100';
4040

41-
interface AppHeaderProps {
41+
type AppHeaderProps = {
4242
breadcrumbs?: BreadcrumbItem[];
4343
}
4444

resources/js/components/app-shell.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { SidebarProvider } from '@/components/ui/sidebar';
22
import { useState } from 'react';
33

4-
interface AppShellProps {
4+
type AppShellProps = {
55
children: React.ReactNode;
66
variant?: 'header' | 'sidebar';
77
}

resources/js/components/icon.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { cn } from '@/lib/utils';
22
import { type LucideProps } from 'lucide-react';
33

4-
interface IconProps extends Omit<LucideProps, 'ref'> {
4+
type IconProps = Omit<LucideProps, 'ref'> & {
55
iconNode: React.ComponentType<LucideProps>;
66
}
77

resources/js/components/ui/badge.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const badgeVariants = cva(
2020
},
2121
);
2222

23-
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {}
23+
export type BadgeProps = React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof badgeVariants>;
2424

2525
function Badge({ className, variant, ...props }: BadgeProps) {
2626
return <div className={cn(badgeVariants({ variant }), className)} {...props} />;

resources/js/components/ui/button.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const buttonVariants = cva(
3030
},
3131
);
3232

33-
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
33+
export type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<typeof buttonVariants> & {
3434
asChild?: boolean;
3535
}
3636

resources/js/components/ui/icon.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { LucideIcon } from 'lucide-react';
22

3-
interface IconProps {
3+
type IconProps = {
44
iconNode?: LucideIcon | null;
55
className?: string;
66
}

resources/js/components/ui/placeholder-pattern.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useId } from 'react';
22

3-
interface PlaceholderPatternProps {
3+
type PlaceholderPatternProps = {
44
className?: string;
55
}
66

resources/js/components/ui/sheet.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const sheetVariants = cva(
4646
},
4747
);
4848

49-
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {}
49+
type SheetContentProps = React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content> & VariantProps<typeof sheetVariants>
5050

5151
const SheetContent = React.forwardRef<React.ElementRef<typeof SheetPrimitive.Content>, SheetContentProps>(
5252
({ side = 'right', className, children, ...props }, ref) => (

resources/js/components/user-menu-content.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { type User } from '@/types';
55
import { Link } from '@inertiajs/react';
66
import { LogOut, Settings } from 'lucide-react';
77

8-
interface UserMenuContentProps {
8+
type UserMenuContentProps = {
99
user: User;
1010
}
1111

resources/js/layouts/app-layout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import AppLayoutTemplate from '@/layouts/app/app-sidebar-layout';
22
import { type BreadcrumbItem } from '@/types';
33

4-
interface AppLayoutProps {
4+
type AppLayoutProps = {
55
children: React.ReactNode;
66
breadcrumbs?: BreadcrumbItem[];
77
}

resources/js/layouts/app/app-header-layout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { AppHeader } from '@/components/app-header';
33
import { AppShell } from '@/components/app-shell';
44
import { type BreadcrumbItem } from '@/types';
55

6-
interface AppHeaderLayoutProps {
6+
type AppHeaderLayoutProps = {
77
children: React.ReactNode;
88
breadcrumbs?: BreadcrumbItem[];
99
}

resources/js/layouts/auth/auth-simple-layout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import AppLogoIcon from '@/components/app-logo-icon';
22
import { Link } from '@inertiajs/react';
33

4-
interface AuthLayoutProps {
4+
type AuthLayoutProps = {
55
children: React.ReactNode;
66
name?: string;
77
title?: string;

resources/js/layouts/auth/auth-split-layout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import AppLogoIcon from '@/components/app-logo-icon';
22
import { type SharedData } from '@/types';
33
import { Link, usePage } from '@inertiajs/react';
44

5-
interface AuthLayoutProps {
5+
type AuthLayoutProps = {
66
children: React.ReactNode;
77
title?: string;
88
description?: string;

resources/js/pages/auth/login.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ import { Input } from '@/components/ui/input';
1010
import { Label } from '@/components/ui/label';
1111
import AuthLayout from '@/layouts/auth-layout';
1212

13-
interface LoginForm {
13+
type LoginForm = {
1414
email: string;
1515
password: string;
1616
remember: boolean;
1717
}
1818

19-
interface LoginProps {
19+
type LoginProps = {
2020
status?: string;
2121
canResetPassword: boolean;
2222
}

resources/js/pages/auth/register.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Input } from '@/components/ui/input';
99
import { Label } from '@/components/ui/label';
1010
import AuthLayout from '@/layouts/auth-layout';
1111

12-
interface RegisterForm {
12+
type RegisterForm = {
1313
name: string;
1414
email: string;
1515
password: string;

resources/js/pages/auth/reset-password.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import { Input } from '@/components/ui/input';
88
import { Label } from '@/components/ui/label';
99
import AuthLayout from '@/layouts/auth-layout';
1010

11-
interface ResetPasswordProps {
11+
type ResetPasswordProps = {
1212
token: string;
1313
email: string;
1414
}
1515

16-
interface ResetPasswordForm {
16+
type ResetPasswordForm = {
1717
token: string;
1818
email: string;
1919
password: string;

resources/js/types/index.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
import { LucideIcon } from 'lucide-react';
22

3-
export interface Auth {
3+
export type Auth = {
44
user: User;
55
}
66

7-
export interface BreadcrumbItem {
7+
export type BreadcrumbItem = {
88
title: string;
99
href: string;
1010
}
1111

12-
export interface NavGroup {
12+
export type NavGroup = {
1313
title: string;
1414
items: NavItem[];
1515
}
1616

17-
export interface NavItem {
17+
export type NavItem = {
1818
title: string;
1919
url: string;
2020
icon?: LucideIcon | null;
2121
isActive?: boolean;
2222
}
2323

24-
export interface SharedData {
24+
export type SharedData = {
2525
name: string;
2626
quote: { message: string; author: string };
2727
auth: Auth;
2828
[key: string]: unknown;
2929
}
3030

31-
export interface User {
31+
export type User = {
3232
id: number;
3333
name: string;
3434
email: string;

0 commit comments

Comments
 (0)