mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-05 03:12:14 +00:00
18 lines
630 B
TypeScript
18 lines
630 B
TypeScript
import { create } from "zustand";
|
|
|
|
import type { PartialScanTarget } from "@/types/partial-scans";
|
|
|
|
interface PartialScanStoreState {
|
|
activeTarget: PartialScanTarget | null;
|
|
openPartialScan: (target: PartialScanTarget) => void;
|
|
closePartialScan: () => void;
|
|
}
|
|
|
|
// Menu items live inside dropdowns that unmount on select, so the confirmation
|
|
// modal is hosted once globally and driven through this store.
|
|
export const usePartialScanStore = create<PartialScanStoreState>((set) => ({
|
|
activeTarget: null,
|
|
openPartialScan: (activeTarget) => set({ activeTarget }),
|
|
closePartialScan: () => set({ activeTarget: null }),
|
|
}));
|