22 lines
539 B
TypeScript
22 lines
539 B
TypeScript
import { HTMLProps } from "react";
|
|
import "./state-pill.css";
|
|
import classNames from "classnames";
|
|
import { StreamState } from "@/const";
|
|
import Pill from "./pill";
|
|
|
|
type StatePillProps = { state: StreamState } & HTMLProps<HTMLSpanElement>;
|
|
|
|
export function StatePill({ state, ...props }: StatePillProps) {
|
|
return (
|
|
<Pill
|
|
{...props}
|
|
className={classNames(
|
|
"uppercase font-white",
|
|
state === StreamState.Live ? "bg-primary" : "bg-layer-1",
|
|
props.className
|
|
)}>
|
|
{state}
|
|
</Pill>
|
|
);
|
|
}
|