1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/src/apps/experimental/components/PlayTargetIcon.tsx
2023-05-18 13:57:51 -04:00

38 lines
1.1 KiB
TypeScript

import React from 'react';
import Cast from '@mui/icons-material/Cast';
import Computer from '@mui/icons-material/Computer';
import Devices from '@mui/icons-material/Devices';
import Smartphone from '@mui/icons-material/Smartphone';
import Tablet from '@mui/icons-material/Tablet';
import Tv from '@mui/icons-material/Tv';
import browser from 'scripts/browser';
import type { PlayTarget } from 'types/playTarget';
const PlayTargetIcon = ({ target }: { target: PlayTarget }) => {
if (!target.deviceType && target.isLocalPlayer) {
if (browser.tv) {
return <Tv />;
} else if (browser.mobile) {
return <Smartphone />;
}
return <Computer />;
}
switch (target.deviceType) {
case 'smartphone':
return <Smartphone />;
case 'tablet':
return <Tablet />;
case 'desktop':
return <Computer />;
case 'cast':
return <Cast />;
case 'tv':
return <Tv />;
default:
return <Devices />;
}
};
export default PlayTargetIcon;