mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-14 05:05:09 +03:00
e3925bcbc0
Issue: https://github.com/StanGirard/quivr/issues/1435 - feat(knowledgeTab): update structure - refactor: change AddKnowledge structure - feat: change AddKnowledge component structure - feat: rework sources logic - feat: change knowledge tab upload process - fix: change knowledge tab fetch, create, update logic - feat: improve added knowledge ui - style: improve responsivity Fix: - https://github.com/StanGirard/quivr/issues/1516 - https://github.com/StanGirard/quivr/issues/1336 - https://github.com/StanGirard/quivr/issues/1204 https://github.com/StanGirard/quivr/assets/63923024/f2917bf3-4ff8-42c6-8149-0b36287441b4
20 lines
545 B
TypeScript
20 lines
545 B
TypeScript
import { UUID } from "crypto";
|
|
import { useParams } from "next/navigation";
|
|
|
|
import { useBrainContext } from "../context/BrainProvider/hooks/useBrainContext";
|
|
|
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
export const useUrlBrain = () => {
|
|
const { allBrains } = useBrainContext();
|
|
|
|
const params = useParams();
|
|
|
|
const brainId = params?.brainId as UUID | undefined;
|
|
const correspondingBrain = allBrains.find((brain) => brain.id === brainId);
|
|
|
|
return {
|
|
brain: correspondingBrain,
|
|
brainId,
|
|
};
|
|
};
|