mirror of
https://github.com/SamyRai/turash.git
synced 2025-12-26 23:01:33 +00:00
- Remove nested git repository from bugulma/frontend/.git - Add all frontend files to main repository tracking - Convert from separate frontend/backend repos to unified monorepo - Preserve all frontend code and development history as tracked files - Eliminate nested repository complexity for simpler development workflow This creates a proper monorepo structure with frontend and backend coexisting in the same repository for easier development and deployment.
49 lines
1.4 KiB
TypeScript
49 lines
1.4 KiB
TypeScript
/**
|
|
* Organization AI analysis hook
|
|
* Handles symbiosis analysis and web intelligence for organizations
|
|
* Separated from other concerns for better SRP
|
|
*/
|
|
|
|
import { useMemo } from 'react';
|
|
import type { Organization } from '@/types.ts';
|
|
import { useAnalyzeSymbiosis, useGetWebIntelligence } from '@/hooks/useGemini.ts';
|
|
import { useOrganizations } from '@/hooks/useOrganizations.ts';
|
|
import { useTranslation } from '@/hooks/useI18n.tsx';
|
|
|
|
export const useOrganizationAI = (organization: Organization | undefined) => {
|
|
const { organizations } = useOrganizations();
|
|
const { t } = useTranslation();
|
|
|
|
const {
|
|
data: symbiosisResult,
|
|
isPending: isAnalyzing,
|
|
error: analysisError,
|
|
refetch: analyzeSymbiosis,
|
|
} = useAnalyzeSymbiosis(organization!, organizations, t);
|
|
|
|
const {
|
|
data: webIntelResult,
|
|
isPending: isFetchingWebIntel,
|
|
error: webIntelError,
|
|
refetch: fetchWebIntelligence,
|
|
} = useGetWebIntelligence(organization?.Name, t);
|
|
|
|
const symbiosisState = useMemo(
|
|
() => ({
|
|
symbiosisResult,
|
|
isAnalyzing,
|
|
analysisError: analysisError?.message || null,
|
|
webIntelResult,
|
|
isFetchingWebIntel,
|
|
webIntelError: webIntelError?.message || null,
|
|
}),
|
|
[symbiosisResult, isAnalyzing, analysisError, webIntelResult, isFetchingWebIntel, webIntelError]
|
|
);
|
|
|
|
return {
|
|
symbiosisState,
|
|
handleAnalyzeSymbiosis: analyzeSymbiosis,
|
|
handleFetchWebIntelligence: fetchWebIntelligence,
|
|
};
|
|
};
|