tring to put token

This commit is contained in:
2026-02-25 19:27:04 -06:00
parent b0d186784f
commit b7aa2fa66b
5 changed files with 71 additions and 12 deletions
+10 -2
View File
@@ -7,7 +7,7 @@ import { useState, ReactNode } from "react";
interface ToggleOption {
key: string;
label: string;
content: ReactNode;
content: ReactNode | (() => ReactNode);
}
interface ToggleProps {
@@ -46,7 +46,15 @@ export default function Toggle({ options, defaultView }: ToggleProps) {
</div>
<div className="padding toggleContent">
{options.find((opt) => opt.key === view)?.content}
{(() => {
const active = options.find((opt) => opt.key === view)?.content;
if (typeof active === "function") {
return active();
}
return active;
})()}
</div>
</section>
);