Skip to content

Commit

Permalink
chore: prep replay components for new ui (#26676)
Browse files Browse the repository at this point in the history
  • Loading branch information
daibhin authored Dec 5, 2024
1 parent fea5382 commit 259c3a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions frontend/src/lib/components/Playlist/Playlist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export type PlaylistSection<T> = {
export type PlaylistProps<T> = {
sections: PlaylistSection<T>[]
listEmptyState: JSX.Element
content: ({ activeItem }: { activeItem: T | null }) => JSX.Element
content: (({ activeItem }: { activeItem: T | null }) => JSX.Element) | null
title?: string
notebooksHref?: string
embedded?: boolean
Expand Down Expand Up @@ -149,7 +149,7 @@ export function Playlist<
onDoubleClick={() => setListCollapsed(!listCollapsed)}
/>
</div>
<div className="Playlist__main">{content({ activeItem })}</div>
{content && <div className="Playlist__main">{content({ activeItem })}</div>}
</div>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ import {
} from './SessionRecordingsPlaylistSettings'
import { SessionRecordingsPlaylistTroubleshooting } from './SessionRecordingsPlaylistTroubleshooting'

export function SessionRecordingsPlaylist(props: SessionRecordingPlaylistLogicProps): JSX.Element {
export function SessionRecordingsPlaylist({
showContent = true,
...props
}: SessionRecordingPlaylistLogicProps & { showContent?: boolean }): JSX.Element {
const logicProps: SessionRecordingPlaylistLogicProps = {
...props,
autoPlay: props.autoPlay ?? true,
Expand Down Expand Up @@ -122,7 +125,7 @@ export function SessionRecordingsPlaylist(props: SessionRecordingPlaylistLogicPr
onSelect={(item) => setSelectedRecordingId(item.id)}
activeItemId={activeSessionRecordingId}
content={({ activeItem }) =>
activeItem ? (
showContent && activeItem ? (
<SessionRecordingPlayer
playerKey={props.logicKey ?? 'playlist'}
sessionRecordingId={activeItem.id}
Expand Down

0 comments on commit 259c3a3

Please sign in to comment.