push
github
1381 of 2785 branches covered (49.59%)
0 of 242 new or added lines in 12 files covered. (0.0%)
13876 of 77373 relevant lines covered (17.93%)
1.8 hits per line
NEW
|
import type { BillingProductLevel } from '@teable/openapi'; |
|
NEW
|
import { create } from 'zustand'; |
× |
NEW
|
|
× |
NEW
|
interface ISpaceSubscriptionState { |
× |
NEW
|
subscribeLevel?: BillingProductLevel; |
× |
NEW
|
closeModal: () => void; |
× |
NEW
|
openModal: (subscribeLevel: BillingProductLevel) => void; |
× |
NEW
|
} |
× |
NEW
|
|
× |
NEW
|
export const useSpaceSubscriptionStore = create<ISpaceSubscriptionState>((set) => ({ |
× |
NEW
|
closeModal: () => {
|
× |
NEW
|
set((state) => { |
× |
NEW
|
return {
|
× |
NEW
|
...state, |
× |
NEW
|
subscribeLevel: undefined, |
× |
NEW
|
}; |
× |
NEW
|
}); |
× |
NEW
|
}, |
× |
NEW
|
openModal: (subscribeLevel: BillingProductLevel) => {
|
× |
NEW
|
set((state) => { |
× |
NEW
|
return {
|
× |
NEW
|
...state, |
× |
NEW
|
subscribeLevel, |
× |
NEW
|
}; |
× |
NEW
|
}); |
× |
NEW
|
}, |
× |
NEW
|
})); |
× |