refactor: update type imports to use 'type' for better TypeScript compatibility across the codebase

This commit is contained in:
2026-05-11 19:06:54 +02:00
parent fd18692110
commit 5ac2dc5277
40 changed files with 75 additions and 74 deletions
@@ -7,7 +7,7 @@ import { useForm } from "react-hook-form"
import { Button } from "@/components/ui/button"
import { signInAction } from "@/lib/actions/auth.actions"
import { SignInFormType, signInSchema } from "@/lib/schemas/auth.schemas"
import { type SignInFormType, signInSchema } from "@/lib/schemas/auth.schemas"
export default function SignInForm() {
const router = useRouter()
@@ -1,4 +1,4 @@
import { UpdateAssignmentFormType } from "@/lib/schemas/assignment.schemas"
import type { UpdateAssignmentFormType } from "@/lib/schemas/assignment.schemas"
import type { Item } from "@/lib/types"
import { AssetService } from "@/services/asset.service"
import { AssignmentService } from "@/services/assignment.service"
@@ -8,10 +8,10 @@ import { toast } from "sonner"
import { SubmitButton } from "@/components/forms/submitButton"
import { updateAssignment } from "@/lib/actions/assignament.actions"
import {
UpdateAssignmentFormType,
type UpdateAssignmentFormType,
updateAssignmentSchema,
} from "@/lib/schemas/assignment.schemas"
import { Asset, Item, Recipient } from "@/lib/types"
import type { Asset, Item, Recipient } from "@/lib/types"
interface Props {
recipients: Recipient[]
@@ -9,10 +9,10 @@ import { toast } from "sonner"
import { SubmitButton } from "@/components/forms/submitButton"
import { createAssignment } from "@/lib/actions/assignament.actions"
import {
CreateAssignmentFormType,
type CreateAssignmentFormType,
createAssignmentSchema,
} from "@/lib/schemas/assignment.schemas"
import { Asset, Item, Recipient } from "@/lib/types"
import type { Asset, Item, Recipient } from "@/lib/types"
interface Props {
recipients: Recipient[]
@@ -7,7 +7,7 @@ import { toast } from "sonner"
import { Button } from "@/components/ui/button"
import { returnAssignment } from "@/lib/actions/assignament.actions"
import { ReturnAssignmentFormType } from "@/lib/schemas/assignment.schemas"
import type { ReturnAssignmentFormType } from "@/lib/schemas/assignment.schemas"
export default function ReturnButton({
assignmentId,
@@ -2,14 +2,14 @@
import { zodResolver } from "@hookform/resolvers/zod"
import { useRouter } from "next/navigation"
import { ChangeEvent } from "react"
import type { ChangeEvent } from "react"
import { useForm } from "react-hook-form"
import { toast } from "sonner"
import { SubmitButton } from "@/components/forms/submitButton"
import { importItems } from "@/lib/actions/import.actions"
import { ImportFormType, importSchema } from "@/lib/schemas/import.schemas"
import { CategorySummary } from "@/lib/types"
import { type ImportFormType, importSchema } from "@/lib/schemas/import.schemas"
import type { CategorySummary } from "@/lib/types"
export default function ImportForm({
categories,
@@ -1,6 +1,6 @@
"use server"
import { AssetWithAssignment } from "@/lib/types"
import type { AssetWithAssignment } from "@/lib/types"
import { AssetService } from "@/services/asset.service"
import { ItemService } from "@/services/item.service"
import { RecipientService } from "@/services/recipient.service"
@@ -9,10 +9,10 @@ import { SubmitButton } from "@/components/forms/submitButton"
import { ItemStatus } from "@/generated/prisma/client"
import { updateAssetAction } from "@/lib/actions/asset.actions"
import {
UpdateAssetFormType,
type UpdateAssetFormType,
updateAssetSchema,
} from "@/lib/schemas/asset.schemas"
import {
import type {
AssetWithAssignment,
Item,
Recipient,
@@ -9,10 +9,10 @@ import { SubmitButton } from "@/components/forms/submitButton"
import { ItemStatus } from "@/generated/prisma/client"
import { createAssetAction } from "@/lib/actions/asset.actions"
import {
CreateAssetFormType,
type CreateAssetFormType,
createAssetSchema,
} from "@/lib/schemas/asset.schemas"
import { ItemWithoutStock, Recipient } from "@/lib/types"
import type { ItemWithoutStock, Recipient } from "@/lib/types"
interface NewAssetFormProps {
items: ItemWithoutStock[]
@@ -8,10 +8,10 @@ import { toast } from "sonner"
import { SubmitButton } from "@/components/forms/submitButton"
import { updateCategoryAction } from "@/lib/actions/category.actions"
import {
UpdateCategoryFormType,
type UpdateCategoryFormType,
updateCategorySchema,
} from "@/lib/schemas/category.schemas"
import { CategorySummary } from "@/lib/types"
import type { CategorySummary } from "@/lib/types"
export default function EditCategoryForm({
category,
@@ -8,7 +8,7 @@ import { toast } from "sonner"
import { SubmitButton } from "@/components/forms/submitButton"
import { createCategoryAction } from "@/lib/actions/category.actions"
import {
CreateCategoryFormType,
type CreateCategoryFormType,
createCategorySchema,
} from "@/lib/schemas/category.schemas"
@@ -8,10 +8,10 @@ import { toast } from "sonner"
import { SubmitButton } from "@/components/forms/submitButton"
import { createItemAction } from "@/lib/actions/item.actions"
import {
CreateItemFormType,
type CreateItemFormType,
createItemSchema,
} from "@/lib/schemas/item.schemas"
import { CategorySummary } from "@/lib/types"
import type { CategorySummary } from "@/lib/types"
export default function NewItemForm({
categories,
@@ -8,10 +8,10 @@ import { toast } from "sonner"
import { SubmitButton } from "@/components/forms/submitButton"
import { updateItemAction } from "@/lib/actions/item.actions"
import {
UpdateItemFormType,
type UpdateItemFormType,
updateItemSchema,
} from "@/lib/schemas/item.schemas"
import { CategorySummary, ItemWithAssetCount } from "@/lib/types"
import type { CategorySummary, ItemWithAssetCount } from "@/lib/types"
export default function UpdateItemForm({
categories,
@@ -12,11 +12,11 @@ import {
updateRecipient,
} from "@/lib/actions/recipient.actions"
import {
CreateRecipientFormType,
type CreateRecipientFormType,
recipientSchema,
UpdateRecipientFormType,
type UpdateRecipientFormType,
} from "@/lib/schemas/recipients.schemas"
import { Recipient } from "@/lib/types"
import type { Recipient } from "@/lib/types"
interface RecipientFormProps {
initialData?: Recipient
+1 -1
View File
@@ -4,7 +4,7 @@ import Link from "next/link"
import PageHeader from "@/components/common/pageheader"
import PaginationButtons from "@/components/common/pagination"
import { Button } from "@/components/ui/button"
import { Recipient } from "@/generated/prisma/client"
import type { Recipient } from "@/generated/prisma/client"
import { RecipientService } from "@/services/recipient.service"
export default async function RecipientsPage(props: {