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 | 2x 2x 2x 2x 529x | import { Typography } from "@mui/material";
import Alert from "components/Alert";
import MarkdownInput from "components/MarkdownInput";
import React from "react";
import { Control } from "react-hook-form";
interface ProfileMarkdownInputProps {
className?: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
control: Control<any>;
defaultValue?: string;
id: string;
label: string;
name: string;
warning?: boolean;
helperText?: string;
}
export default function ProfileMarkdownInput({
className,
control,
defaultValue = "",
id,
label,
name,
warning,
helperText,
}: ProfileMarkdownInputProps) {
return (
<div className={className}>
<Typography variant="h2" id={`${id}-label`}>
{label}
</Typography>
{warning && helperText && <Alert severity="warning">{helperText}</Alert>}
<MarkdownInput
control={control}
defaultValue={defaultValue}
id={id}
labelId={`${id}-label`}
name={name}
/>
</div>
);
}
|