import { Button, Card, Text, makeStyles, shorthands, tokens } from '@fluentui/react-components'; import type { CyclicSchemaExpandProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils'; import { ID_KEY, TranslatableString } from '@rjsf/utils'; const useStyles = makeStyles({ card: { backgroundColor: tokens.colorStatusWarningBackground1, marginTop: tokens.spacingVerticalL, '&::after': { ...shorthands.borderColor(tokens.colorStatusWarningBorder1), }, }, buttonRow: { marginTop: tokens.spacingVerticalS, }, }); /** The `CyclicSchemaExpandTemplate` is the template to use to render the cyclic schema expand message and controls * * @param props - The `CyclicSchemaExpandProps` for this component */ export default function CyclicSchemaExpandTemplate< T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any, >(props: CyclicSchemaExpandProps) { const { name, fieldPathId, registry, onExpand } = props; const { translateString } = registry; const classes = useStyles(); const buttonId = `${fieldPathId[ID_KEY]}-button`; return ( {translateString(TranslatableString.CycleDetected, [name])}
); }