refactor: clean up and reorganize imports in various components for improved readability and consistency
This commit is contained in:
parent
93828b6da9
commit
34190253e5
@ -17,7 +17,6 @@ import { FieldGroup } from "@/components/ui/field"
|
|||||||
import { Input } from "@/components/ui/input"
|
import { Input } from "@/components/ui/input"
|
||||||
import { Label } from "@/components/ui/label"
|
import { Label } from "@/components/ui/label"
|
||||||
import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group';
|
import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group';
|
||||||
import { SelectTrigger } from '@/components/ui/select';
|
|
||||||
import payrollRoutes from '@/routes/payroll';
|
import payrollRoutes from '@/routes/payroll';
|
||||||
import type { Payroll } from '@/types';
|
import type { Payroll } from '@/types';
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
import { usePrinter } from '@/hooks/use-printer';
|
|
||||||
import { EscPosEncoder } from '@/lib/esc-pos-encoder';
|
|
||||||
import type { Order } from '@/types/order';
|
|
||||||
import { format } from 'date-fns';
|
import { format } from 'date-fns';
|
||||||
import { id } from 'date-fns/locale';
|
import { id } from 'date-fns/locale';
|
||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
|
import { usePrinter } from '@/hooks/use-printer';
|
||||||
|
import { EscPosEncoder } from '@/lib/esc-pos-encoder';
|
||||||
|
import type { Order } from '@/types/order';
|
||||||
|
|
||||||
export function useOrderPrint() {
|
export function useOrderPrint() {
|
||||||
const {
|
const {
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
|
import { Head, Link } from '@inertiajs/react';
|
||||||
|
import { Plus, Trash2 } from 'lucide-react';
|
||||||
import { DataTable } from '@/components/data-table';
|
import { DataTable } from '@/components/data-table';
|
||||||
import { DeleteConfirmation } from '@/components/modal/delete-confirmation';
|
import { DeleteConfirmation } from '@/components/modal/delete-confirmation';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Card, CardContent } from '@/components/ui/card';
|
import { Card, CardContent } from '@/components/ui/card';
|
||||||
import { Head, Link } from '@inertiajs/react';
|
|
||||||
import { Plus, Trash2 } from 'lucide-react';
|
|
||||||
|
|
||||||
import * as orderRoutes from '@/routes/order';
|
import * as orderRoutes from '@/routes/order';
|
||||||
import type { Order } from '@/types/order';
|
import type { Order } from '@/types/order';
|
||||||
|
|||||||
@ -1,14 +1,14 @@
|
|||||||
|
import { Link } from '@inertiajs/react';
|
||||||
|
import type { ColumnDef } from '@tanstack/react-table';
|
||||||
|
import { format } from 'date-fns';
|
||||||
|
import { id } from 'date-fns/locale';
|
||||||
|
import { Pencil, Printer, Trash2 } from 'lucide-react';
|
||||||
import { DataTableColumnHeader } from '@/components/data-table-column-header';
|
import { DataTableColumnHeader } from '@/components/data-table-column-header';
|
||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';
|
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';
|
||||||
import * as orderRoutes from '@/routes/order';
|
import * as orderRoutes from '@/routes/order';
|
||||||
import type { Order } from '@/types/order';
|
import type { Order } from '@/types/order';
|
||||||
import { Link } from '@inertiajs/react';
|
|
||||||
import type { ColumnDef } from '@tanstack/react-table';
|
|
||||||
import { format } from 'date-fns';
|
|
||||||
import { id } from 'date-fns/locale';
|
|
||||||
import { Pencil, Printer, Trash2 } from 'lucide-react';
|
|
||||||
|
|
||||||
interface ColumnProps {
|
interface ColumnProps {
|
||||||
onDelete: (order: Order) => void;
|
onDelete: (order: Order) => void;
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import { Bluetooth, Printer, Unplug, Usb } from 'lucide-react';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import {
|
import {
|
||||||
DropdownMenu,
|
DropdownMenu,
|
||||||
@ -12,7 +13,6 @@ import {
|
|||||||
DropdownMenuSubTrigger,
|
DropdownMenuSubTrigger,
|
||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from "@/components/ui/dropdown-menu";
|
} from "@/components/ui/dropdown-menu";
|
||||||
import { Bluetooth, Printer, Unplug, Usb } from 'lucide-react';
|
|
||||||
|
|
||||||
interface PrinterSettingsProps {
|
interface PrinterSettingsProps {
|
||||||
isConnected: boolean;
|
isConnected: boolean;
|
||||||
|
|||||||
@ -19,8 +19,6 @@ import { Field, FieldError } from "@/components/ui/field";
|
|||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { Label } from "@/components/ui/label";
|
import { Label } from "@/components/ui/label";
|
||||||
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
|
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
|
||||||
import type { Product, ProductPrice } from '@/types';
|
|
||||||
import { cn } from '@/lib/utils';
|
|
||||||
import { ScrollArea } from '@/components/ui/scroll-area';
|
import { ScrollArea } from '@/components/ui/scroll-area';
|
||||||
import {
|
import {
|
||||||
Select,
|
Select,
|
||||||
@ -35,7 +33,9 @@ import {
|
|||||||
SheetTrigger,
|
SheetTrigger,
|
||||||
SheetClose,
|
SheetClose,
|
||||||
} from "@/components/ui/sheet";
|
} from "@/components/ui/sheet";
|
||||||
|
import { cn } from '@/lib/utils';
|
||||||
import purchaseRoutes from '@/routes/purchase';
|
import purchaseRoutes from '@/routes/purchase';
|
||||||
|
import type { Product, ProductPrice } from '@/types';
|
||||||
|
|
||||||
type CartItem = { product_id: number; quantity: number; unit_price: number; product: Product };
|
type CartItem = { product_id: number; quantity: number; unit_price: number; product: Product };
|
||||||
|
|
||||||
|
|||||||
@ -19,8 +19,6 @@ import { Field, FieldError } from "@/components/ui/field";
|
|||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { Label } from "@/components/ui/label";
|
import { Label } from "@/components/ui/label";
|
||||||
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
|
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
|
||||||
import type { Product, ProductPrice, Purchase } from '@/types';
|
|
||||||
import { cn } from '@/lib/utils';
|
|
||||||
import { ScrollArea } from '@/components/ui/scroll-area';
|
import { ScrollArea } from '@/components/ui/scroll-area';
|
||||||
import {
|
import {
|
||||||
Select,
|
Select,
|
||||||
@ -35,7 +33,9 @@ import {
|
|||||||
SheetTrigger,
|
SheetTrigger,
|
||||||
SheetClose,
|
SheetClose,
|
||||||
} from "@/components/ui/sheet";
|
} from "@/components/ui/sheet";
|
||||||
|
import { cn } from '@/lib/utils';
|
||||||
import purchaseRoutes from '@/routes/purchase';
|
import purchaseRoutes from '@/routes/purchase';
|
||||||
|
import type { Product, ProductPrice, Purchase } from '@/types';
|
||||||
|
|
||||||
type CartItem = { product_id: number; quantity: number; unit_price: number; product: Product };
|
type CartItem = { product_id: number; quantity: number; unit_price: number; product: Product };
|
||||||
|
|
||||||
|
|||||||
@ -3,9 +3,8 @@ import { Plus, Trash2 } from 'lucide-react';
|
|||||||
import { DataTable } from '@/components/data-table';
|
import { DataTable } from '@/components/data-table';
|
||||||
|
|
||||||
import { DeleteConfirmation } from '@/components/modal/delete-confirmation';
|
import { DeleteConfirmation } from '@/components/modal/delete-confirmation';
|
||||||
import {
|
|
||||||
AlertDialogMedia,
|
|
||||||
} from "@/components/ui/alert-dialog"
|
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Card, CardContent } from '@/components/ui/card';
|
import { Card, CardContent } from '@/components/ui/card';
|
||||||
import { formatDate } from '@/lib/formatters';
|
import { formatDate } from '@/lib/formatters';
|
||||||
|
|||||||
@ -19,11 +19,11 @@ import {
|
|||||||
useComboboxAnchor,
|
useComboboxAnchor,
|
||||||
} from "@/components/ui/combobox"
|
} from "@/components/ui/combobox"
|
||||||
import { Field, FieldError } from "@/components/ui/field"
|
import { Field, FieldError } from "@/components/ui/field"
|
||||||
import { Category } from '@/types/category';
|
|
||||||
import { Input } from "@/components/ui/input"
|
import { Input } from "@/components/ui/input"
|
||||||
import { Label } from "@/components/ui/label"
|
import { Label } from "@/components/ui/label"
|
||||||
import productRoutes from '@/routes/product';
|
import productRoutes from '@/routes/product';
|
||||||
import type { Product, ProductPrice } from '@/types';
|
import type { Product, ProductPrice } from '@/types';
|
||||||
|
import type { Category } from '@/types/category';
|
||||||
|
|
||||||
interface ExistingImage {
|
interface ExistingImage {
|
||||||
kind: 'existing';
|
kind: 'existing';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user