mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2026-02-04 01:46:47 +00:00
* optional mixdown * optional mixdown --------- Co-authored-by: Igor Loskutov <igor.loskutoff@gmail.com>
28 lines
654 B
TypeScript
28 lines
654 B
TypeScript
import { useTranscriptTopics } from "../../lib/apiHooks";
|
|
import type { components } from "../../reflector-api";
|
|
import { parseMaybeNonEmptyString } from "../../lib/utils";
|
|
|
|
type GetTranscriptTopic = components["schemas"]["GetTranscriptTopic"];
|
|
|
|
type TranscriptTopics = {
|
|
topics: GetTranscriptTopic[] | null;
|
|
loading: boolean;
|
|
error: Error | null;
|
|
};
|
|
|
|
const useTopics = (id: string): TranscriptTopics => {
|
|
const {
|
|
data: topics,
|
|
isLoading: loading,
|
|
error,
|
|
} = useTranscriptTopics(parseMaybeNonEmptyString(id));
|
|
|
|
return {
|
|
topics: topics || null,
|
|
loading,
|
|
error: error as Error | null,
|
|
};
|
|
};
|
|
|
|
export default useTopics;
|