Files
firegex-traffic-viewer/frontend/src/components/OnOffButton.tsx
Domingo Dirutigliano cbf2c5a43d add: frontend update
2024-10-13 01:50:52 +02:00

12 lines
515 B
TypeScript

import { ActionIcon, ActionIconProps, PolymorphicComponentProps } from "@mantine/core"
import { ImCheckmark, ImCross } from "react-icons/im"
interface IOnOffButtonProps extends Omit<PolymorphicComponentProps<"button",ActionIconProps>, "value">{
value: boolean,
}
export const OnOffButton = ({value, ...props}:IOnOffButtonProps) => {
return <ActionIcon color={props.color?props.color:(value?"green":"red")} {...props}>
{value?<ImCheckmark size={14} />:<ImCross size={12} />}
</ActionIcon>
}