Files
authentik/website/src/components/SupportBadge.tsx
Teffen Ellis bfdb827ff9 website/docs: Update Docusaurus config. Prep for version picker. (#14401)
* website/docs: Clean up config. Add types.

* website/docs: Format MDX.

* website: Fix build warnings. Lint badges frontmatter.
2025-05-06 10:04:39 -04:00

32 lines
840 B
TypeScript

import { SupportLevelToLabel, isSupportLevel } from "@site/remark/support-directive.mjs";
import React from "react";
export interface SupportBadgeProps {
level: string;
}
/**
* Badge indicating the support level of a feature or integration.
*/
export const SupportBadge: React.FC<SupportBadgeProps> = ({ level }) => {
if (!isSupportLevel(level)) {
throw new TypeError(`Invalid support level: ${level}`);
}
const label = SupportLevelToLabel[level];
const className = `badge badge--support-${level}`;
return (
<span
aria-description="Support level badge"
title={`This feature is supported at the ${label} level.`}
role="img"
className={className}
>
Support level: {label}
</span>
);
};
export default SupportBadge;