export default function twuiSlugToNormalText(str?: string) {
    if (!str) return "";

    return str
        .toLowerCase()
        .replace(/ /g, "-")
        .replace(/[^a-z0-9\-]/g, "-")
        .replace(/-{2,}/g, "-")
        .replace(/[-]/g, " ")
        .split(" ")
        .map(
            (word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()
        )
        .join(" ");
}
