Transcriptions filtering and search

This commit is contained in:
2024-10-03 18:25:53 +02:00
parent 895ba36cb9
commit ebb32ee613
7 changed files with 410 additions and 200 deletions

View File

@@ -10,7 +10,11 @@ type TranscriptList = {
refetch: () => void;
};
const useTranscriptList = (page: number): TranscriptList => {
const useTranscriptList = (
page: number,
roomId: string | null,
searchTerm: string | null,
): TranscriptList => {
const [response, setResponse] = useState<Page_GetTranscript_ | null>(null);
const [loading, setLoading] = useState<boolean>(true);
const [error, setErrorState] = useState<Error | null>(null);
@@ -27,7 +31,7 @@ const useTranscriptList = (page: number): TranscriptList => {
if (!api) return;
setLoading(true);
api
.v1TranscriptsList({ page })
.v1TranscriptsList({ page, roomId, searchTerm })
.then((response) => {
setResponse(response);
setLoading(false);
@@ -38,7 +42,7 @@ const useTranscriptList = (page: number): TranscriptList => {
setError(err);
setErrorState(err);
});
}, [!api, page, refetchCount]);
}, [!api, page, refetchCount, roomId, searchTerm]);
return { response, loading, error, refetch };
};