2022-02-28 00:08:20 +01:00
|
|
|
export interface EpisodeProps {
|
|
|
|
progress?: number;
|
|
|
|
episodeNumber: number;
|
2022-03-06 18:31:22 +01:00
|
|
|
onClick?: () => void;
|
|
|
|
active?: boolean;
|
2022-02-28 00:08:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export function Episode(props: EpisodeProps) {
|
|
|
|
return (
|
2022-03-06 18:31:22 +01:00
|
|
|
<div
|
|
|
|
onClick={props.onClick}
|
2022-03-13 15:27:08 +01:00
|
|
|
className={`bg-denim-500 hover:bg-denim-400 transition-[background-color, transform, box-shadow] relative mr-3 mb-3 inline-flex h-10 w-10 cursor-pointer select-none items-center justify-center overflow-hidden rounded font-bold text-white active:scale-110 ${
|
|
|
|
props.active ? "shadow-bink-500 shadow-[inset_0_0_0_2px]" : ""
|
2022-03-06 18:31:22 +01:00
|
|
|
}`}
|
|
|
|
>
|
2022-02-28 00:08:20 +01:00
|
|
|
<div
|
|
|
|
className="bg-bink-500 absolute bottom-0 top-0 left-0 bg-opacity-50"
|
|
|
|
style={{
|
|
|
|
width: `${props.progress || 0}%`,
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
<span className="relative">{props.episodeNumber}</span>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|