import { create } from 'zustand';

interface SelectedUser {
    color: string;
    name: string;
    id: string,
    location?: {
        position: {
            x: number;
            y: number;
            z: number;
        };
        rotation?: {
            x: number;
            y: number;
            z: number;
        };
        target?: {
            x: number;
            y: number;
            z: number;
        };
    }
}

interface SelectedUserStore {
    selectedUser: SelectedUser | null;
    setSelectedUser: (user: SelectedUser) => void;
    clearSelectedUser: () => void;
}

export const useSelectedUserStore = create<SelectedUserStore>((set) => ({
    selectedUser: null,
    setSelectedUser: (user) => set({ selectedUser: user }),
    clearSelectedUser: () => set({ selectedUser: null }),
}));
