Spaces:
Paused
Paused
| // No-op Supabase server client — app uses local storage only. | |
| export async function createClient() { | |
| const mockUser = { | |
| id: 'beta-test-user', | |
| email: 'beta@test.local', | |
| } | |
| const mockProfile = { | |
| id: 'beta-user', | |
| email: 'beta@test.local', | |
| full_name: 'Beta User', | |
| avatar_url: null, | |
| is_premium: true, | |
| created_at: new Date().toISOString(), | |
| } | |
| return { | |
| auth: { | |
| getUser: async () => ({ data: { user: mockUser }, error: null }), | |
| getSession: async () => ({ data: { session: { user: mockUser } }, error: null }), | |
| signOut: async () => {}, | |
| }, | |
| from: (_table: string) => ({ | |
| select: () => ({ | |
| eq: (_field: string, _value: any) => ({ | |
| single: async () => ({ data: mockProfile, error: null }), | |
| order: () => ({ limit: () => ({ data: [mockProfile], error: null }) }), | |
| }), | |
| }), | |
| insert: async (_data: any) => ({ data: mockProfile, error: null }), | |
| update: (_data: any) => ({ | |
| eq: async (_field: string, _value: any) => ({ data: mockProfile, error: null }), | |
| }), | |
| delete: () => ({ | |
| eq: async (_field: string, _value: any) => ({ data: null, error: null }), | |
| }), | |
| }), | |
| } | |
| } | |