app/frontend/src/components/ui/Label.tsx

25 lines
No EOL
544 B
TypeScript

import React, {FC, ReactNode} from "react";
interface LabelProps {
href?: string;
children: ReactNode;
onClick?: () => void;
}
const Label: FC<LabelProps> = ({ href, children, onClick }) => {
const styles = "items-center space-x-1 background-accent p-2 rounded"
if (href !== undefined) {
return (
<div className={styles}>
{ children}
</div>
)
}
return <button className={styles} onClick={onClick}>
{ children }
</button>
}
export default Label