pull/3769/merge
Bob Ziroll 1 month ago committed by GitHub
commit 3011dd0c69
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -15,16 +15,21 @@ const StatusBadgeMini = ({
status, status,
is4k = false, is4k = false,
inProgress = false, inProgress = false,
shrink = false, shrink = true,
}: StatusBadgeMiniProps) => { }: StatusBadgeMiniProps) => {
const badgeStyle = [ const badgeStyle = [
`rounded-full bg-opacity-80 shadow-md ${ `bg-opacity-80 shadow-md w-full h-full pl-3.5 md:pl-4 ${
shrink ? 'w-4 sm:w-5 border p-0' : 'w-5 ring-1 p-0.5' shrink ? 'border' : 'ring-1'
}`, }`,
]; ];
let indicatorIcon: React.ReactNode; let indicatorIcon: React.ReactNode;
// clip-path not directly supported in Tailwind.
const triangleStyle = {
clipPath: 'polygon(100% 0, 100% 100%, 0 0)',
};
switch (status) { switch (status) {
case MediaStatus.PROCESSING: case MediaStatus.PROCESSING:
badgeStyle.push( badgeStyle.push(
@ -58,11 +63,13 @@ const StatusBadgeMini = ({
return ( return (
<div <div
className={`relative inline-flex whitespace-nowrap rounded-full border-gray-700 text-xs font-semibold leading-5 ring-gray-700 ${ className={`absolute top-0 right-0 inline-flex whitespace-nowrap border-gray-700 text-xs font-semibold leading-5 ring-gray-700 ${
shrink ? '' : 'ring-1' shrink ? 'h-9 w-9 md:h-10 md:w-10' : 'h-10 w-10 ring-1'
}`} }`}
> >
<div className={badgeStyle.join(' ')}>{indicatorIcon}</div> <div className={badgeStyle.join(' ')} style={triangleStyle}>
{indicatorIcon}
</div>
{is4k && <span className="pl-1 pr-2 text-gray-200">4K</span>} {is4k && <span className="pl-1 pr-2 text-gray-200">4K</span>}
</div> </div>
); );

Loading…
Cancel
Save