summaryrefslogtreecommitdiffstats
path: root/src/ui/objects/StatusIndicator.tsx
blob: 06b6481ec3c66e8d4a8ee45ead9a59e60b1950f0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import type { HTMLAttributes } from "corvos/plugins/jsx.ts";

export type Props = HTMLAttributes<"div"> & {
	status?: "accent" | "positive" | "negative" | "warning";
};

export const StatusIndicator = ({ status, class: cls, ...props }: Props) => (
	<div
		class:list={[
			"o-status-indicator",
			{
				[`is-${status}`]: status,
			},
			cls,
		]}
		{...props}
	/>
);