mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-23 05:39:05 +00:00
feat: complete migration from @hey-api/openapi-ts to openapi-react-query
- Migrated all components from useApi compatibility layer to direct React Query hooks - Added new hooks for participant operations, room meetings, and speaker operations - Updated all imports from old api module to api-types - Fixed TypeScript types and API endpoint signatures - Removed deprecated useApi.ts compatibility layer - Fixed SourceKind enum values to match OpenAPI spec - Added @ts-ignore for Zulip endpoints not in OpenAPI spec yet - Fixed all compilation errors and type issues
This commit is contained in:
@@ -10,6 +10,13 @@ interface FilterSidebarProps {
|
||||
onFilterChange: (sourceKind: SourceKind | null, roomId: string) => void;
|
||||
}
|
||||
|
||||
// Type helper for source kind literals
|
||||
const SK = {
|
||||
room: "room" as SourceKind,
|
||||
live: "live" as SourceKind,
|
||||
file: "file" as SourceKind,
|
||||
};
|
||||
|
||||
export default function FilterSidebar({
|
||||
rooms,
|
||||
selectedSourceKind,
|
||||
@@ -44,14 +51,14 @@ export default function FilterSidebar({
|
||||
key={room.id}
|
||||
as={NextLink}
|
||||
href="#"
|
||||
onClick={() => onFilterChange("room", room.id)}
|
||||
onClick={() => onFilterChange(SK.room, room.id)}
|
||||
color={
|
||||
selectedSourceKind === "room" && selectedRoomId === room.id
|
||||
selectedSourceKind === SK.room && selectedRoomId === room.id
|
||||
? "blue.500"
|
||||
: "gray.600"
|
||||
}
|
||||
fontWeight={
|
||||
selectedSourceKind === "room" && selectedRoomId === room.id
|
||||
selectedSourceKind === SK.room && selectedRoomId === room.id
|
||||
? "bold"
|
||||
: "normal"
|
||||
}
|
||||
@@ -72,14 +79,14 @@ export default function FilterSidebar({
|
||||
key={room.id}
|
||||
as={NextLink}
|
||||
href="#"
|
||||
onClick={() => onFilterChange("room", room.id)}
|
||||
onClick={() => onFilterChange(SK.room, room.id)}
|
||||
color={
|
||||
selectedSourceKind === "room" && selectedRoomId === room.id
|
||||
selectedSourceKind === SK.room && selectedRoomId === room.id
|
||||
? "blue.500"
|
||||
: "gray.600"
|
||||
}
|
||||
fontWeight={
|
||||
selectedSourceKind === "room" && selectedRoomId === room.id
|
||||
selectedSourceKind === SK.room && selectedRoomId === room.id
|
||||
? "bold"
|
||||
: "normal"
|
||||
}
|
||||
@@ -95,10 +102,10 @@ export default function FilterSidebar({
|
||||
<Link
|
||||
as={NextLink}
|
||||
href="#"
|
||||
onClick={() => onFilterChange("live", "")}
|
||||
color={selectedSourceKind === "live" ? "blue.500" : "gray.600"}
|
||||
onClick={() => onFilterChange(SK.live, "")}
|
||||
color={selectedSourceKind === SK.live ? "blue.500" : "gray.600"}
|
||||
_hover={{ color: "blue.300" }}
|
||||
fontWeight={selectedSourceKind === "live" ? "bold" : "normal"}
|
||||
fontWeight={selectedSourceKind === SK.live ? "bold" : "normal"}
|
||||
fontSize="sm"
|
||||
>
|
||||
Live Transcripts
|
||||
@@ -106,10 +113,10 @@ export default function FilterSidebar({
|
||||
<Link
|
||||
as={NextLink}
|
||||
href="#"
|
||||
onClick={() => onFilterChange("file", "")}
|
||||
color={selectedSourceKind === "file" ? "blue.500" : "gray.600"}
|
||||
onClick={() => onFilterChange(SK.file, "")}
|
||||
color={selectedSourceKind === SK.file ? "blue.500" : "gray.600"}
|
||||
_hover={{ color: "blue.300" }}
|
||||
fontWeight={selectedSourceKind === "file" ? "bold" : "normal"}
|
||||
fontWeight={selectedSourceKind === SK.file ? "bold" : "normal"}
|
||||
fontSize="sm"
|
||||
>
|
||||
Uploaded Files
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
highlightMatches,
|
||||
generateTextFragment,
|
||||
} from "../../../lib/textHighlight";
|
||||
import { SearchResult } from "../../../lib/api-types";
|
||||
import { SearchResult, SourceKind } from "../../../lib/api-types";
|
||||
|
||||
interface TranscriptCardsProps {
|
||||
results: SearchResult[];
|
||||
@@ -120,7 +120,7 @@ function TranscriptCard({
|
||||
: "N/A";
|
||||
const formattedDate = formatLocalDate(result.created_at);
|
||||
const source =
|
||||
result.source_kind === "room"
|
||||
result.source_kind === ("room" as SourceKind)
|
||||
? result.room_name || result.room_id
|
||||
: result.source_kind;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user