2024-05-27 20:48:00 +02:00

30 lines
662 B
Plaintext

---
import type { EndpointAudio } from "src/shared/payload/payload-sdk";
interface Props {
audio: EndpointAudio;
class?: string | undefined;
}
const {
audio: { url, mimeType },
...otherProps
} = Astro.props;
---
{/* ------------------------------------------- HTML ------------------------------------------- */}
<audio controls {...otherProps.class ? otherProps : {}}>
<source src={url} type={mimeType} />
</audio>
{/* ------------------------------------------- CSS -------------------------------------------- */}
<style>
audio {
width: 100%;
border-radius: 16px;
box-shadow: 0 5px 20px -10px var(--color-shadow-0);
}
</style>