import player from '@/web/states/player' import { css, cx } from '@emotion/css' import { useQuery } from '@tanstack/react-query' import { useState } from 'react' import { useSnapshot } from 'valtio' const useAirplayDevices = () => { return useQuery(['useAirplayDevices'], () => window.ipcRenderer?.invoke('airplay-scan-devices') ) } const Airplay = () => { const [showPanel, setShowPanel] = useState(false) const { data: devices, isLoading } = useAirplayDevices() const { remoteDevice } = useSnapshot(player) const selectedAirplayDeviceID = remoteDevice?.protocol === 'airplay' ? remoteDevice?.id : '' return (