fix: react-doctor no-barrel-import 20→1 (direct design-system imports)
Convert ./design-system barrel imports to direct file paths across 19 admin components. Remaining 1 (db/client.ts) is Drizzle schema which legitimately requires namespace import for drizzle() helper.
This commit is contained in:
@@ -16,19 +16,14 @@ import { markPickupComplete } from "@/actions/pickup";
|
|||||||
import { createAdminOrder, type AdminCreateOrderItem } from "@/actions/orders/create-admin-order";
|
import { createAdminOrder, type AdminCreateOrderItem } from "@/actions/orders/create-admin-order";
|
||||||
import { formatDate } from "@/lib/format-date";
|
import { formatDate } from "@/lib/format-date";
|
||||||
import AdminBadge from "./design-system/AdminBadge";
|
import AdminBadge from "./design-system/AdminBadge";
|
||||||
import {
|
import AdminButton, { AdminIconButton } from "./design-system/AdminButton";
|
||||||
AdminButton,
|
import AdminSearchInput from "./design-system/AdminSearchInput";
|
||||||
AdminSearchInput,
|
import AdminFilterTabs from "./design-system/AdminFilterTabs";
|
||||||
AdminFilterTabs,
|
import { useToast } from "./Toast";
|
||||||
AdminIconButton,
|
import { AdminInput, AdminTextInput, AdminSelect } from "./design-system/AdminFormElements";
|
||||||
useToast,
|
import EmptyState from "./EmptyState";
|
||||||
AdminInput,
|
import KPIStat from "./KPIStat";
|
||||||
AdminTextInput,
|
import { Skeleton } from "./design-system/Skeleton";
|
||||||
AdminSelect,
|
|
||||||
EmptyState,
|
|
||||||
KPIStat,
|
|
||||||
} from "./design-system";
|
|
||||||
import { Skeleton } from "./design-system";
|
|
||||||
|
|
||||||
type OrderItem = {
|
type OrderItem = {
|
||||||
id: string;
|
id: string;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
uploadOlatheSweetLogoDark,
|
uploadOlatheSweetLogoDark,
|
||||||
type BrandSettings,
|
type BrandSettings,
|
||||||
} from "@/actions/brand-settings";
|
} from "@/actions/brand-settings";
|
||||||
import { AdminInput, AdminTextInput, AdminTextarea, AdminSelect } from "./design-system";
|
import { AdminInput, AdminTextInput, AdminTextarea, AdminSelect } from "./design-system/AdminFormElements";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
settings: BrandSettings | null;
|
settings: BrandSettings | null;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { useState, useCallback } from "react";
|
|||||||
import type { Contact, ContactSource } from "@/actions/communications/contacts";
|
import type { Contact, ContactSource } from "@/actions/communications/contacts";
|
||||||
import { getContacts, deleteContact, exportContacts } from "@/actions/communications/contacts";
|
import { getContacts, deleteContact, exportContacts } from "@/actions/communications/contacts";
|
||||||
import { formatDate } from "@/lib/format-date";
|
import { formatDate } from "@/lib/format-date";
|
||||||
import { AdminButton } from "./design-system";
|
import AdminButton from "./design-system/AdminButton";
|
||||||
|
|
||||||
const SOURCE_COLORS: Record<ContactSource, string> = {
|
const SOURCE_COLORS: Record<ContactSource, string> = {
|
||||||
order: "bg-blue-100 text-blue-700",
|
order: "bg-blue-100 text-blue-700",
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { updateWaterHeadgate, deleteWaterHeadgate } from "@/actions/water-log/admin";
|
import { updateWaterHeadgate, deleteWaterHeadgate } from "@/actions/water-log/admin";
|
||||||
import { AdminInput, AdminTextInput, AdminSelect } from "./design-system";
|
import { AdminInput, AdminTextInput, AdminSelect } from "./design-system/AdminFormElements";
|
||||||
import { AdminButton } from "./design-system";
|
import AdminButton from "./design-system/AdminButton";
|
||||||
|
|
||||||
type Headgate = {
|
type Headgate = {
|
||||||
id: string;
|
id: string;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
import { useState, useEffect, useCallback } from "react";
|
import { useState, useEffect, useCallback } from "react";
|
||||||
import { getMessageLogs, type MessageLogEntry } from "@/actions/communications/send";
|
import { getMessageLogs, type MessageLogEntry } from "@/actions/communications/send";
|
||||||
import { formatDate } from "@/lib/format-date";
|
import { formatDate } from "@/lib/format-date";
|
||||||
import { AdminButton } from "./design-system";
|
import AdminButton from "./design-system/AdminButton";
|
||||||
|
|
||||||
const PAGE_SIZE = 20;
|
const PAGE_SIZE = 20;
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { useState, useRef } from "react";
|
|||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { uploadProductImage } from "@/actions/products/upload-image";
|
import { uploadProductImage } from "@/actions/products/upload-image";
|
||||||
import { createProduct } from "@/actions/products/create-product";
|
import { createProduct } from "@/actions/products/create-product";
|
||||||
import { AdminInput, AdminTextInput, AdminTextarea, AdminSelect } from "./design-system";
|
import { AdminInput, AdminTextInput, AdminTextarea, AdminSelect } from "./design-system/AdminFormElements";
|
||||||
|
|
||||||
async function resizeImage(file: File, maxWidth: number): Promise<ArrayBuffer> {
|
async function resizeImage(file: File, maxWidth: number): Promise<ArrayBuffer> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|||||||
@@ -4,7 +4,9 @@ import { useState } from "react";
|
|||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { createStop } from "@/actions/stops/create-stop";
|
import { createStop } from "@/actions/stops/create-stop";
|
||||||
import { AdminInput, AdminTextInput, AdminSelect, AdminButton, useToast } from "./design-system";
|
import { AdminInput, AdminTextInput, AdminSelect } from "./design-system/AdminFormElements";
|
||||||
|
import AdminButton from "./design-system/AdminButton";
|
||||||
|
import { useToast } from "./Toast";
|
||||||
|
|
||||||
type Stop = {
|
type Stop = {
|
||||||
city: string;
|
city: string;
|
||||||
|
|||||||
@@ -3,7 +3,9 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { updateOrder, updateOrderItem, deleteOrderItem } from "@/actions/orders/update-order";
|
import { updateOrder, updateOrderItem, deleteOrderItem } from "@/actions/orders/update-order";
|
||||||
import { AdminInput, AdminTextInput, AdminTextarea, useToast, AdminButton } from "./design-system";
|
import { AdminInput, AdminTextInput, AdminTextarea } from "./design-system/AdminFormElements";
|
||||||
|
import { useToast } from "./Toast";
|
||||||
|
import AdminButton from "./design-system/AdminButton";
|
||||||
|
|
||||||
type OrderItem = {
|
type OrderItem = {
|
||||||
id: string;
|
id: string;
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ import { useRouter } from "next/navigation";
|
|||||||
import { formatDate } from "@/lib/format-date";
|
import { formatDate } from "@/lib/format-date";
|
||||||
import { updateOrder } from "@/actions/orders/update-order";
|
import { updateOrder } from "@/actions/orders/update-order";
|
||||||
import { createRefund } from "@/actions/orders/create-refund";
|
import { createRefund } from "@/actions/orders/create-refund";
|
||||||
import { useToast, AdminButton, AdminInput } from "./design-system";
|
import { useToast } from "./Toast";
|
||||||
|
import AdminButton from "./design-system/AdminButton";
|
||||||
|
|
||||||
type Refund = {
|
type Refund = {
|
||||||
id: string;
|
id: string;
|
||||||
|
|||||||
@@ -6,8 +6,9 @@ import { useState, useEffect } from "react";
|
|||||||
import { savePaymentSettings, type PaymentProvider, type PaymentSettings } from "@/actions/payments";
|
import { savePaymentSettings, type PaymentProvider, type PaymentSettings } from "@/actions/payments";
|
||||||
import { syncSquareNow, getSyncLog, type SyncLogEntry } from "@/actions/square-sync-ui";
|
import { syncSquareNow, getSyncLog, type SyncLogEntry } from "@/actions/square-sync-ui";
|
||||||
import WebhookLogsSection from "@/components/admin/WebhookLogsSection";
|
import WebhookLogsSection from "@/components/admin/WebhookLogsSection";
|
||||||
import { AdminInput, AdminTextInput, AdminSelect, AdminButton } from "./design-system";
|
import { AdminInput, AdminTextInput, AdminSelect } from "./design-system/AdminFormElements";
|
||||||
import { AdminToggle } from "./design-system/AdminToggle";
|
import AdminButton from "./design-system/AdminButton";
|
||||||
|
import AdminToggle from "./design-system/AdminToggle";
|
||||||
|
|
||||||
type InventoryMode = "none" | "rc_to_square" | "square_to_rc" | "bidirectional";
|
type InventoryMode = "none" | "rc_to_square" | "square_to_rc" | "bidirectional";
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { useState, useRef } from "react";
|
|||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { uploadProductImage, deleteProductImage } from "@/actions/products/upload-image";
|
import { uploadProductImage, deleteProductImage } from "@/actions/products/upload-image";
|
||||||
import { updateProduct } from "@/actions/products/update-product";
|
import { updateProduct } from "@/actions/products/update-product";
|
||||||
import { AdminInput, AdminTextInput, AdminTextarea, AdminSelect } from "./design-system";
|
import { AdminInput, AdminTextInput, AdminTextarea, AdminSelect } from "./design-system/AdminFormElements";
|
||||||
|
|
||||||
async function resizeImage(file: File, maxWidth: number): Promise<ArrayBuffer> {
|
async function resizeImage(file: File, maxWidth: number): Promise<ArrayBuffer> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|||||||
@@ -20,8 +20,9 @@ import {
|
|||||||
type TimeTrackingSettings,
|
type TimeTrackingSettings,
|
||||||
type NotificationLogEntry,
|
type NotificationLogEntry,
|
||||||
} from "@/actions/time-tracking";
|
} from "@/actions/time-tracking";
|
||||||
import { AdminToggle } from "./design-system/AdminToggle";
|
import AdminToggle from "./design-system/AdminToggle";
|
||||||
import { AdminInput, AdminTextInput, AdminSelect, AdminButton } from "./design-system";
|
import { AdminInput, AdminTextInput, AdminSelect } from "./design-system/AdminFormElements";
|
||||||
|
import AdminButton from "./design-system/AdminButton";
|
||||||
|
|
||||||
const DAYS = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
const DAYS = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
||||||
|
|
||||||
|
|||||||
@@ -6,15 +6,13 @@ import { Truck, Search, Package, ExternalLink, Sprout, X } from "lucide-react";
|
|||||||
import { updateShippingStatus } from "@/actions/shipping";
|
import { updateShippingStatus } from "@/actions/shipping";
|
||||||
import { getFedExRates, type FedExRate, type FedExServiceType } from "@/actions/shipping/fedex-rates";
|
import { getFedExRates, type FedExRate, type FedExServiceType } from "@/actions/shipping/fedex-rates";
|
||||||
import { createFedExShipment } from "@/actions/shipping/fedex-labels";
|
import { createFedExShipment } from "@/actions/shipping/fedex-labels";
|
||||||
import {
|
import AdminButton from "./design-system/AdminButton";
|
||||||
AdminButton,
|
import AdminSearchInput from "./design-system/AdminSearchInput";
|
||||||
AdminSearchInput,
|
import AdminFilterTabs from "./design-system/AdminFilterTabs";
|
||||||
AdminFilterTabs,
|
import AdminBadge from "./design-system/AdminBadge";
|
||||||
AdminBadge,
|
import AdminEmptyState from "./design-system/AdminEmptyState";
|
||||||
AdminEmptyState,
|
import AdminCard from "./design-system/AdminCard";
|
||||||
AdminCard,
|
import GlassModal from "./GlassModal";
|
||||||
GlassModal,
|
|
||||||
} from "./design-system";
|
|
||||||
|
|
||||||
type OrderItem = {
|
type OrderItem = {
|
||||||
id: string;
|
id: string;
|
||||||
|
|||||||
@@ -7,8 +7,9 @@ import {
|
|||||||
testFedExConnection,
|
testFedExConnection,
|
||||||
type ShippingSettings,
|
type ShippingSettings,
|
||||||
} from "@/actions/shipping/settings";
|
} from "@/actions/shipping/settings";
|
||||||
import { AdminInput, AdminTextInput, AdminTextarea, AdminSelect, AdminButton } from "./design-system";
|
import { AdminInput, AdminTextInput, AdminTextarea, AdminSelect } from "./design-system/AdminFormElements";
|
||||||
import { AdminToggle } from "./design-system/AdminToggle";
|
import AdminButton from "./design-system/AdminButton";
|
||||||
|
import AdminToggle from "./design-system/AdminToggle";
|
||||||
|
|
||||||
const SERVICE_OPTIONS = [
|
const SERVICE_OPTIONS = [
|
||||||
{ value: "FEDEX_OVERNIGHT", label: "FedEx Overnight" },
|
{ value: "FEDEX_OVERNIGHT", label: "FedEx Overnight" },
|
||||||
|
|||||||
@@ -3,7 +3,9 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { updateStop } from "@/actions/stops/update-stop";
|
import { updateStop } from "@/actions/stops/update-stop";
|
||||||
import { AdminInput, AdminTextInput, AdminSelect, AdminButton, useToast } from "./design-system";
|
import { AdminInput, AdminTextInput, AdminSelect } from "./design-system/AdminFormElements";
|
||||||
|
import AdminButton from "./design-system/AdminButton";
|
||||||
|
import { useToast } from "./Toast";
|
||||||
|
|
||||||
type Brand = {
|
type Brand = {
|
||||||
id: string;
|
id: string;
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ import {
|
|||||||
} from "@/actions/time-tracking";
|
} from "@/actions/time-tracking";
|
||||||
import { formatDate } from "@/lib/format-date";
|
import { formatDate } from "@/lib/format-date";
|
||||||
import TimeTrackingSettingsClient from "./TimeTrackingSettingsClient";
|
import TimeTrackingSettingsClient from "./TimeTrackingSettingsClient";
|
||||||
import { AdminButton, AdminFilterTabs } from "./design-system";
|
import AdminButton from "./design-system/AdminButton";
|
||||||
|
import AdminFilterTabs from "./design-system/AdminFilterTabs";
|
||||||
|
|
||||||
// One-color outline icons
|
// One-color outline icons
|
||||||
const Icons = {
|
const Icons = {
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ import {
|
|||||||
type WaterLogReportRow,
|
type WaterLogReportRow,
|
||||||
} from "@/lib/water-log-reporting";
|
} from "@/lib/water-log-reporting";
|
||||||
import { WaterGauge, SeasonMark } from "@/components/water/icons";
|
import { WaterGauge, SeasonMark } from "@/components/water/icons";
|
||||||
import { AdminButton } from "./design-system";
|
import AdminButton from "./design-system/AdminButton";
|
||||||
import { formatDate, formatDateTime } from "@/lib/format-date";
|
import { formatDate, formatDateTime } from "@/lib/format-date";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { updateWaterEntry, deleteWaterEntry } from "@/actions/water-log/admin";
|
import { updateWaterEntry, deleteWaterEntry } from "@/actions/water-log/admin";
|
||||||
import { AdminInput, AdminTextInput, AdminTextarea, AdminSelect, AdminButton } from "./design-system";
|
import { AdminInput, AdminTextInput, AdminTextarea, AdminSelect } from "./design-system/AdminFormElements";
|
||||||
|
import AdminButton from "./design-system/AdminButton";
|
||||||
|
|
||||||
type WaterEntry = {
|
type WaterEntry = {
|
||||||
id: string;
|
id: string;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { updateWaterIrrigator, resetWaterIrrigatorPin, deleteWaterUser } from "@/actions/water-log/admin";
|
import { updateWaterIrrigator, resetWaterIrrigatorPin, deleteWaterUser } from "@/actions/water-log/admin";
|
||||||
import { AdminButton } from "./design-system";
|
import AdminButton from "./design-system/AdminButton";
|
||||||
|
|
||||||
type WaterUser = {
|
type WaterUser = {
|
||||||
id: string;
|
id: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user