Added text for the option in the option buttons component

now you know what the option does no way
This commit is contained in:
Puppet committed 2025-07-31 22:05:55 -07:00
1 parent b8a4ef3754
commit f922ec5116
3 files changed
+18 -10

No files matched your search

+5 -1
View File
@@ -4,6 +4,10 @@ button {
@apply bg-[rgb(54,54,72)] hover:bg-[rgb(72,72,96)] border border-[rgb(72,72,96)] hover:border-[rgb(96,96,128)] m-1 p-2 rounded-lg transition-colors cursor-pointer; @apply bg-[rgb(54,54,72)] hover:bg-[rgb(72,72,96)] border border-[rgb(72,72,96)] hover:border-[rgb(96,96,128)] m-1 p-2 rounded-lg transition-colors cursor-pointer;
} }
h2 {
@apply mx-auto;
}
.container { .container {
@apply bg-[rgb(24,24,36)] mt-10 p-5 border border-[rgb(48,48,72)] rounded-lg justify-center mx-auto w-fit flex gap-2; @apply bg-[rgb(24,24,36)] mt-10 p-5 border border-[rgb(48,48,72)] rounded-lg justify-center mx-auto w-fit flex flex-col gap-2;
} }
+12 -6
View File
@@ -7,16 +7,22 @@ type ButtonOption = {
type OptionButtonsProps = { type OptionButtonsProps = {
buttons: ButtonOption[]; buttons: ButtonOption[];
name: string;
}; };
export default function OptionButtons({ buttons }: OptionButtonsProps) { export default function OptionButtons({ buttons, name }: OptionButtonsProps) {
return ( return (
<> <>
{buttons.map((btn, index) => ( <div className='container'>
<button key={index} onClick={btn.onClick}> <h2>{name}</h2>
{btn.label} <div className="flex gap-2">
</button> {buttons.map((btn, index) => (
))} <button key={index} onClick={btn.onClick}>
{btn.label}
</button>
))}
</div>
</div>
</> </>
); );
} }
+1 -3
View File
@@ -6,15 +6,13 @@ export default function Home () {
return ( return (
<> <>
<div className='container'>
<p>Project Type: {projectType}</p>
<OptionButtons <OptionButtons
buttons={[ buttons={[
{ label: 'Website', onClick: () => setProjectType('website') }, { label: 'Website', onClick: () => setProjectType('website') },
{ label: 'Web Server', onClick: () => setProjectType('webserver') } { label: 'Web Server', onClick: () => setProjectType('webserver') }
]} ]}
name="Project Type"
/> />
</div>
</> </>
) )
} }