mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 15:58:38 +01:00
17 lines
451 B
TypeScript
17 lines
451 B
TypeScript
|
|
|
|
|
|
const insight = ref<string>("");
|
|
const insightStatus = ref<'success' | 'pending'>('pending');
|
|
|
|
async function insightRefresh() {
|
|
if (isSelfhosted()) return;
|
|
insightStatus.value = 'pending';
|
|
insight.value = await useAuthFetchSync('/api/ai/insight');
|
|
insightStatus.value = 'success';
|
|
}
|
|
|
|
export function useInsight() {
|
|
if (insightStatus.value !== 'success') insightRefresh();
|
|
return { insight, insightRefresh, insightStatus }
|
|
} |