Make name not required in OptionButtons Componet

This commit is contained in:
Lncvrt committed 2025-08-06 21:10:23 -07:00
1 parent 4a4e1d6b02
commit 258ce6eb6d
1 file changed
+10 -10
+10 -10
View File
@@ -1,21 +1,21 @@
import './OptionButtons.css'
type ButtonOption = {
label: string;
onClick: () => void;
};
label: string
onClick: () => void
}
type OptionButtonsProps = {
buttons: ButtonOption[];
name: string;
};
buttons: ButtonOption[]
name: string | null
}
export default function OptionButtons({ buttons, name }: OptionButtonsProps) {
export default function OptionButtons ({ buttons, name }: OptionButtonsProps) {
return (
<>
<div className='container'>
<h2>{name}</h2>
<div className="flex gap-2">
<h2 style={{ display: name == null ? 'none' : 'block' }}>{name}</h2>
<div className='flex gap-2'>
{buttons.map((btn, index) => (
<button key={index} onClick={btn.onClick}>
{btn.label}
@@ -24,5 +24,5 @@ export default function OptionButtons({ buttons, name }: OptionButtonsProps) {
</div>
</div>
</>
);
)
}