dishplanner/frontend/app/components/ui/Label.tsx
2025-11-09 13:09:22 +01:00

25 lines
No EOL
529 B
TypeScript

import React from "react";
interface LabelProps {
href?: string;
children: React.ReactNode;
onClick?: () => void;
}
const Label = ({ href, children, onClick }: LabelProps) => {
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