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

25 lines
529 B
TypeScript
Raw Normal View History

2025-11-09 13:09:22 +01:00
import React from "react";
2025-10-13 14:57:11 +02:00
interface LabelProps {
href?: string;
2025-11-09 13:09:22 +01:00
children: React.ReactNode;
2025-10-13 14:57:11 +02:00
onClick?: () => void;
}
2025-11-09 13:09:22 +01:00
const Label = ({ href, children, onClick }: LabelProps) => {
2025-10-13 14:57:11 +02:00
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