Initial commit — eLegal Software monorepo

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Leon Serfaty
2026-04-26 02:42:42 -04:00
co-authored by Claude Sonnet 4.6
commit 0700d54225
160 changed files with 22771 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
import { useMutation, useQuery } from '@tanstack/react-query';
import { api, type ApiError } from '@/lib/api';
export interface BillingStatus {
configured: boolean;
plan: 'starter' | 'pro' | 'lifetime';
hasSubscription: boolean;
hasCustomer: boolean;
}
export function useBillingStatus() {
return useQuery<BillingStatus>({
queryKey: ['billing', 'status'],
queryFn: () => api.get('/api/billing/status'),
});
}
export function useStartCheckout() {
return useMutation<{ url: string }, ApiError, { plan: 'pro' | 'lifetime' }>({
mutationFn: (body) => api.post('/api/billing/checkout', body),
});
}
export function useOpenPortal() {
return useMutation<{ url: string }, ApiError, void>({
mutationFn: () => api.post('/api/billing/portal'),
});
}