Skip to content

Commit

Permalink
🔄 refactor(imports): standardize type imports using @pft-types alias
Browse files Browse the repository at this point in the history
- Update type imports across the project to use the new @pft-types alias
- Replace individual file imports with centralized imports from index
  • Loading branch information
ad956 committed Aug 29, 2024
1 parent 6f7f519 commit 090b34d
Show file tree
Hide file tree
Showing 26 changed files with 25 additions and 193 deletions.
2 changes: 1 addition & 1 deletion app/(pages)/admin/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Divider, User, Button, Image } from "@nextui-org/react";
import Link from "next/link";
import Notifications from "@components/Notifications";
import { logoutAction } from "@lib/actions";
import { Admin } from "@types";
import { Admin } from "@pft-types/index";
import { CiLogin } from "react-icons/ci";

interface HeaderProps {
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/admin/components/Transactions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
TransactionsTable,
} from "@components/index";
import useFilterTransaction from "@hooks/useFilterTransaction";
import { TransactionDetails } from "@types";
import { TransactionDetails } from "@pft-types/index";

const statusColorMap: any = {
Failed: "danger",
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/admin/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Metadata } from "next";
import { Sidebar, Header } from "./components";
import { Admin } from "@types";
import { Admin } from "@pft-types/index";
import { getAdminData } from "@lib/admin";

export const metadata: Metadata = {
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/admin/settings/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Admin } from "@types";
import { Admin } from "@pft-types/index";
import getAdminData from "@lib/admin/getAdminData";
import ProfileSettings from "@components/ProfileSettings";

Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/admin/transactions/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TransactionDetails } from "@types";
import { TransactionDetails } from "@pft-types/index";
import Transactions from "../components/Transactions";
import getTransactions from "@lib/admin/getTransactions";

Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/doctor/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Sidebar, Headbar } from "@components/index";
import { getDoctorData } from "@lib/doctor";
import { Doctor } from "@types";
import { Doctor } from "@pft-types/index";

import type { Metadata } from "next";

Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/hospital/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Sidebar, Headbar } from "@components/index";
import { getHospitalData } from "@lib/hospital";
import { Hospital } from "@types";
import { Hospital } from "@pft-types/index";

import type { Metadata } from "next";

Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/patient/appointments/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Card, Image } from "@nextui-org/react";
import { BookAppointment } from "../components";
import { Patient } from "@types";
import { Patient } from "@pft-types/index";
import { getPatientData } from "@lib/patient";

export default async function Appointments() {
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/patient/components/Calendar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from "react";
import { type DateFormatter, DayPicker } from "react-day-picker";
import { Card, useDisclosure } from "@nextui-org/react";
import { getFormattedDate } from "@utils/getDate";
import { bookedAppointments } from "@types";
import { bookedAppointments } from "@pft-types/index";
import AppointmentDetailsModal from "../AppointmentDetailsModal";

type upcomingAppointmentsType = {
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/patient/components/MedicalDetails/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { MedicalHistory } from "@types";
import { MedicalHistory } from "@pft-types/index";
import {
Chip,
Spinner,
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/patient/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Script from "next/script";
import { Sidebar, Headbar } from "@components/index";
import { Patient } from "@types";
import { Patient } from "@pft-types/index";
import { getPatientData } from "@lib/patient";

import type { Metadata } from "next";
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/patient/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
MedicineDetails,
HealthConditions,
} from "./components";
import { Patient, bookedAppointments } from "@types";
import { Patient, bookedAppointments } from "@pft-types/index";
import { getPatientData, getUpcomingAppointments } from "@lib/patient";

export default async function PatientPage() {
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/patient/qrcode/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getPatientData } from "@lib/patient";
import { Patient } from "@types";
import { Patient } from "@pft-types/index";
import { Card, Link, User } from "@nextui-org/react";
import { QRCode } from "../components";

Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/patient/settings/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Patient } from "@types";
import { Patient } from "@pft-types/index";
import { getPatientData } from "@lib/patient";
import ProfileSettings from "@components/ProfileSettings";

Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/receptionist/components/PatientTabs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
ModalBody,
ModalFooter,
} from "@nextui-org/react";
import { PatientDetails } from "@types";
import { PatientDetails } from "@pft-types/index";
import { getFormattedDate } from "@utils/getDate";
import { approveAppointment } from "@lib/receptionist";
import toast, { Toaster } from "react-hot-toast";
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/receptionist/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Receptionist } from "@types";
import { Receptionist } from "@pft-types/index";
import { Sidebar, Headbar } from "@components/index";

import type { Metadata } from "next";
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/receptionist/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
BsSearch,
BsBell,
} from "react-icons/bs";
import { Receptionist } from "@types";
import { Receptionist } from "@pft-types/index";
import { getReceptionistData, getPendingAppointments } from "@lib/receptionist";
import {
MonthlyVisitors,
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/receptionist/settings/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ProfileSettings from "@components/ProfileSettings";
import { getReceptionistData } from "@lib/receptionist";
import { Receptionist } from "@types";
import { Receptionist } from "@pft-types/index";

export default async function Settings() {
const receptionist: Receptionist = await getReceptionistData();
Expand Down
2 changes: 1 addition & 1 deletion app/api/admin/transactions/route.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dbConfig from "@utils/db";
import { decrypt } from "@sessions/sessionUtils";
import { Admin, Hospital, Patient, Transaction } from "@models/index";
import { TransactionDetails } from "@types";
import { TransactionDetails } from "@pft-types/index";

export async function GET(request: Request) {
const session = request.headers.get("Authorization");
Expand Down
2 changes: 1 addition & 1 deletion app/api/patient/appointment/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { dbConfig } from "@utils/index";
import { bookingAppointment } from "@types";
import { bookingAppointment } from "@pft-types/index";
import { decrypt } from "@sessions/sessionUtils";
import { Types } from "mongoose";
import sendEmail from "@lib/sendemail";
Expand Down
2 changes: 1 addition & 1 deletion app/api/transactions/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import dbConfig from "@utils/db";
import { Transaction as TransactionType } from "@types";
import { Transaction as TransactionType } from "@pft-types/index";
import Transaction from "@models/transaction";
import { Types } from "mongoose";

Expand Down
2 changes: 1 addition & 1 deletion app/components/Headbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Link from "next/link";
import { Button, Divider, User } from "@nextui-org/react";
import { CiLogin } from "react-icons/ci";
import { GoPlus } from "react-icons/go";
import { User as UserType } from "@types";
import { User as UserType } from "@pft-types/index";
import { logoutAction } from "@lib/actions";
import Notifications from "../Notifications";

Expand Down
2 changes: 1 addition & 1 deletion app/components/ProfileSettings/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { User } from "@types";
import { User } from "@pft-types/index";
import {
Input,
Button,
Expand Down
2 changes: 1 addition & 1 deletion app/lib/emails/templates.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UserLog, bookingAppointment } from "@types";
import { UserLog, bookingAppointment } from "@pft-types/index";
import { Html } from "@react-email/html";
import { getCurrentDateFormatted, getFormattedDate } from "@utils/getDate";
import React from "react";
Expand Down
2 changes: 1 addition & 1 deletion app/lib/patient/bookAppointment.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use server";
import { bookingAppointment } from "@types";
import { bookingAppointment } from "@pft-types/index";
import { getSessionToken } from "../sessions/sessionUtils";
import getBaseUrl from "@utils/getBaseUrl";

Expand Down
168 changes: 0 additions & 168 deletions types.d.ts

This file was deleted.

0 comments on commit 090b34d

Please sign in to comment.