teableio/teable

View on GitHub
apps/nextjs-app/src/store/user.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { create } from 'zustand';

export interface IUser {
  id: string;
  name: string;
  description: string;
  avatar: string;
}

const defaultUser: IUser = {
  id: 'default-user',
  name: 'Default user',
  description: '',
  avatar: '',
};

interface IUserState {
  currentUser: IUser;
}

export const useUserStore = create<IUserState>()(() => ({
  currentUser: defaultUser,
}));