"use client";
import { vipnagorgialla } from "@/components/Vipnagorgialla";
interface RuleSection {
title: string;
rules: (
| string
| { main: string; sub: (string | { main: string; sub: string[] })[] }
)[];
}
interface RulesContentProps {
sections: RuleSection[];
}
function RuleItem({
rule,
index,
}: {
rule:
| string
| { main: string; sub: (string | { main: string; sub: string[] })[] };
index: number;
}) {
if (typeof rule === "string") {
return (
{/* Fixed min-width prevents numbers from shifting text as digits grow (e.g., 9. vs 10.) */}
{index}.
{rule}
);
}
return (
{/* Main rule row */}
{rule.sub && rule.sub.length > 0 && (
{rule.sub.map((subRule, subIndex) => {
if (typeof subRule === "string") {
return (
-
{index}.{subIndex + 1}.
{subRule}
);
}
return (
-
{index}.{subIndex + 1}.
{subRule.main}
{subRule.sub && subRule.sub.length > 0 && (
{subRule.sub.map((subSubRule, subSubIndex) => (
-
{index}.{subIndex + 1}.{subSubIndex + 1}.
{subSubRule}
))}
)}
);
})}
)}
);
}
export default function RulesContent({ sections }: RulesContentProps) {
return (
{sections.map((section, sectionIndex) => (
{sectionIndex + 1}) {section.title}
{section.rules.map((rule, ruleIndex) => (
))}
))}
);
}