Files
oh-my-pi/python/robomp/web/src/components/Pill.tsx
T
can1357 2c773a12a4 Add 'python/robomp/' from commit '553fd1cfcf59e4c501c54fc81bc083ffd2ca007b'
git-subtree-dir: python/robomp
git-subtree-mainline: 4f6e70f779
git-subtree-split: 553fd1cfcf
2026-05-16 21:00:42 +02:00

25 lines
552 B
TypeScript

import type { JSX } from "solid-js";
export interface PillProps {
state?: string;
dot?: boolean;
title?: string;
class?: string;
children?: JSX.Element;
}
export function Pill(props: PillProps): JSX.Element {
const className = (): string => {
const parts = ["pill"];
if (props.state) parts.push(props.state);
if (props.dot) parts.push("dot");
if (props.class) parts.push(props.class);
return parts.join(" ");
};
return (
<span class={className()} title={props.title}>
{props.children}
</span>
);
}