radio-station/app/components/station-player.tsx
Luke Bunselmeyer b107af9bd9 - UI
- Moved PageLayout to /listen routes
  - Enabled persistent player across navgiation
2023-05-07 20:46:19 -04:00

23 lines
717 B
TypeScript

import type { StationWithTagsClientSide } from "~/models/station.server";
export type StationPlayerProps = {
station: StationWithTagsClientSide | null
};
export function StationPlayer({ station }: StationPlayerProps) {
if (!station) {
return <></>;
}
return (
<div
className="fixed bottom-0 left-0 w-full h-[70px] px-4 py-2 z-50 flex justify-end content-center items-center gap-2"
data-theme="aqua">
<h3 className="text-xl">Now Playing: <strong>{station.name}</strong></h3>
<audio controls autoPlay src={station.streamUrl}>
Your browser does not support the audio element.
</audio>
</div>
);
}