mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-26 10:55:27 +00:00
* feat(search): add image similarity search * feat(search): support pasting image attachments
18 lines
576 B
TypeScript
18 lines
576 B
TypeScript
import { client } from '@/ui/api/client'
|
|
import { m } from '@/ui/paraglide/messages.js'
|
|
import { useQuery } from '@tanstack/react-query'
|
|
|
|
export function useSemanticSearchEnabled(teamId: string, enabled: boolean): boolean {
|
|
const { data } = useQuery({
|
|
queryKey: ['team-settings', teamId],
|
|
queryFn: async () => {
|
|
const res = await client.api.teams[':teamId'].settings.$get({ param: { teamId } })
|
|
if (!res.ok) throw new Error(m.failed_load_settings())
|
|
return await res.json()
|
|
},
|
|
enabled,
|
|
})
|
|
|
|
return data?.semanticSearchEnabled ?? false
|
|
}
|