mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-07 01:13:21 +00:00
bf6f7430e7
Mark JS imports as type-only when applicable so they are stripped at build time and ignored during chunk splitting, ensuring we take full advantage of Rollup's code-splitting optimizations.
22 lines
589 B
TypeScript
22 lines
589 B
TypeScript
import type { Participant } from 'livekit-client'
|
|
import { useRoomData } from '../livekit/hooks/useRoomData'
|
|
import { fetchApi } from '@/api/fetchApi'
|
|
|
|
export const useRemoveParticipant = () => {
|
|
const data = useRoomData()
|
|
|
|
const removeParticipant = async (participant: Participant) => {
|
|
if (!data?.id) {
|
|
throw new Error('Room id is not available')
|
|
}
|
|
|
|
return fetchApi(`rooms/${data.id}/remove-participant/`, {
|
|
method: 'POST',
|
|
body: JSON.stringify({
|
|
participant_identity: participant.identity,
|
|
}),
|
|
})
|
|
}
|
|
return { removeParticipant }
|
|
}
|