2026-07-01 23:21:50 -04:00
import React from 'react' ;
import { Box , Icon , IconButton , Icons , Scroll , Text } from 'folds' ;
import { Page , PageContent , PageHeader } from '../../../components/page' ;
import { useRoom } from '../../../hooks/useRoom' ;
import { RoomSoundboardPack , UserSoundboardPack } from '../../../components/soundboard-pack-view' ;
type SoundboardProps = {
requestClose : () => void ;
};
/**
* Soundboard management page (Room/Space settings). Mirrors the Emojis &
* Stickers page: a shared room/space pack (admin-editable, inherited by child
* rooms like emoji packs) plus the user's personal pack. A single default room
* pack (state key "") is used per room/space.
*/
export function Soundboard ({ requestClose } : SoundboardProps ) {
const room = useRoom ();
return (
< Page >
< PageHeader outlined = { false }>
< Box grow = "Yes" gap = "200" >
< Box grow = "Yes" alignItems = "Center" gap = "200" >
< Text as = "h2" size = "H3" truncate >
Soundboard
</ Text >
</ Box >
< Box shrink = "No" >
< IconButton onClick = { requestClose } variant = "Surface" aria-label = "Close" >
< Icon src = { Icons . Cross } />
</ IconButton >
</ Box >
</ Box >
</ PageHeader >
< Box grow = "Yes" >
< Scroll hideTrack visibility = "Hover" >
< PageContent >
< Box direction = "Column" gap = "700" >
< Box direction = "Column" gap = "200" >
2026-10-19 15:26:21 -04:00
< Text size = "L400" >
{ room ? . isSpaceRoom () ? 'This space (shared)' : 'This room (shared)' }
</ Text >
2026-07-01 23:21:50 -04:00
< Text size = "T200" priority = "300" >
2026-10-19 15:26:21 -04:00
{ /* [Gitea #279] Only a space's clips are inherited by rooms under it. */ }
{ room ? . isSpaceRoom ()
? 'Clips here are shared with everyone, and inherited by every room under this space — just like emoji/sticker packs. Only members with permission can edit.'
: 'Clips here are shared with everyone in this room — just like emoji/sticker packs. Only members with permission can edit.' }
2026-07-01 23:21:50 -04:00
</ Text >
{ room && < RoomSoundboardPack room = { room } stateKey = "" />}
</ Box >
< Box direction = "Column" gap = "200" >
< Text size = "L400" > Personal </ Text >
< Text size = "T200" priority = "300" >
Your own clips , available in every call and synced across your devices .
</ Text >
< UserSoundboardPack />
</ Box >
</ Box >
</ PageContent >
</ Scroll >
</ Box >
</ Page >
);
}