-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
14 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 12 additions & 3 deletions
15
plugins/audio-recorder/view/AudioRecorderRemote/Recording/RecordingSection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
import { Stack, Text } from "@chakra-ui/react"; | ||
import { useMemo } from "react"; | ||
|
||
import { usePluginAPI } from "../../pluginApi"; | ||
import { RecordingCard } from "./RecordingCard"; | ||
|
||
export const RecordingSection = () => { | ||
const pluginApi = usePluginAPI(); | ||
const recordings = pluginApi.scene.useData((x) => x.pluginData.recordings); | ||
|
||
const endedRecordings = useMemo( | ||
() => recordings.filter((x) => x.status === "ended"), | ||
[recordings], | ||
); | ||
|
||
return ( | ||
<> | ||
{recordings | ||
.filter((x) => x.status === "ended") | ||
.map((recording) => ( | ||
{endedRecordings.length === 0 && <Text>Nothing here yet.</Text>} | ||
<Stack direction="column" spacing={4}> | ||
{endedRecordings.map((recording) => ( | ||
<RecordingCard key={recording.mediaId} recording={recording} /> | ||
))} | ||
</Stack> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters