import { create } from 'zustand'

export interface FuelState {
    regionId: number | undefined
    cityId: number | undefined
}

export const useFuelStore = create<FuelState>(() => {
    return {
        regionId: undefined,
        cityId: undefined
    }
})

export const getRegionId = () => useFuelStore.getState().regionId
export const setRegionId = (id: number | undefined) => useFuelStore.setState(() => ({ regionId: id }))

export const getCityId = () => useFuelStore.getState().cityId
export const setCityId = (id: number | undefined) => useFuelStore.setState(() => ({ cityId: id }))