Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | 32x 4x 32x | import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";
import { handleSupportLinkClick } from "./oneMACFAQContent";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
export interface Template {
title: string;
text?: string;
href: string;
subtext?: string[];
}
export const renderSection = (
title: string,
templates: Template[],
filterCondition: (template: Template) => boolean,
ulClassName: string = "",
) => (
<>
<p>{title}</p>
<ul className={cn("list-disc pl-6 space-y-2", ulClassName)}>
{templates.filter(filterCondition).map((template) => (
<li key={template.title}>
<a
href={template.href}
download
target="_blank"
rel="noopener noreferrer"
className="text-blue-600"
onClick={handleSupportLinkClick("template")}
>
{template.title}: {template.text}
</a>
{template.subtext && template.subtext.length > 0 && (
<ul className="list-disc pl-6 space-y-1">
{template.subtext.map((sub, index) => (
<li key={index} className="text-sm text-gray-600">
{sub}
</li>
))}
</ul>
)}
</li>
))}
</ul>
</>
);
|