
import {create} from "zustand";

export interface RecordState {
	selectedUser?: string;
	training: boolean;
	setSelectedUser: (selectedUser: string | undefined) => void;
	setTraining: (training: boolean) => void;
}

export const initialState = {
	selectedUser: undefined,
	training: false
};

const recordStore = create<RecordState>((set) => ({
	...initialState,
    setSelectedUser: (selectedUser: string | undefined) => set(() => ({selectedUser})),
	setTraining: (training: boolean) => set(() => ({training})),
}));

export default recordStore;
