You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
426 B
27 lines
426 B
import { useToggle } from 'hooks'
|
|
|
|
export type Props = {
|
|
onSelect: (quality: string) => void,
|
|
selectedQuality: string,
|
|
videoQualities: Array<string>,
|
|
}
|
|
|
|
export const useSettings = ({ onSelect }: Props) => {
|
|
const {
|
|
close,
|
|
isOpen,
|
|
open,
|
|
} = useToggle()
|
|
|
|
const onItemClick = (quality: string) => {
|
|
onSelect(quality)
|
|
close()
|
|
}
|
|
|
|
return {
|
|
close,
|
|
isOpen,
|
|
onItemClick,
|
|
open,
|
|
}
|
|
}
|
|
|