Initial commit: Port Nimara CRM (Layers 0-4)
Full CRM rebuild with Next.js 15, TypeScript, Tailwind, Drizzle ORM, PostgreSQL, Redis, BullMQ, MinIO, and Socket.io. Includes 461 source files covering clients, berths, interests/pipeline, documents/EOI, expenses/invoices, email, notifications, dashboard, admin, and client portal. CI/CD via Gitea Actions with Docker builds. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
31
src/hooks/use-port.ts
Normal file
31
src/hooks/use-port.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
'use client';
|
||||
|
||||
import { useUIStore } from '@/stores/ui-store';
|
||||
import { usePortContext } from '@/providers/port-provider';
|
||||
import type { Port } from '@/lib/db/schema/ports';
|
||||
|
||||
interface UsePortReturn {
|
||||
currentPort: Port | null;
|
||||
currentPortId: string | null;
|
||||
currentPortSlug: string | null;
|
||||
ports: Port[];
|
||||
setPort: (portId: string, portSlug: string) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hook to get current port context from Zustand store and PortContext.
|
||||
*/
|
||||
export function usePort(): UsePortReturn {
|
||||
const { currentPort, ports } = usePortContext();
|
||||
const currentPortId = useUIStore((s) => s.currentPortId);
|
||||
const currentPortSlug = useUIStore((s) => s.currentPortSlug);
|
||||
const setPort = useUIStore((s) => s.setPort);
|
||||
|
||||
return {
|
||||
currentPort,
|
||||
currentPortId,
|
||||
currentPortSlug,
|
||||
ports,
|
||||
setPort,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user