app/frontend/src/components/ui/Label.tsx
myrmidex e383de82a4 Improve style consistency (#5)
Reviewed-on: https://codeberg.org/lvl0/dish-planner/pulls/5
Co-authored-by: myrmidex <myrmidex@myrmidex.net>
Co-committed-by: myrmidex <myrmidex@myrmidex.net>
2025-10-13 17:39:00 +02:00

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