Skip to content

Commit

Permalink
Fix the ssh key validation (#35)
Browse files Browse the repository at this point in the history
The component is referencing its own Props type. To fix this, wen need to define
the DiscoverySourceSetupModalProps interface/type separately before the component.

Signed-off-by: Ondra Machacek <omachace@redhat.com>
  • Loading branch information
machacekondra authored Nov 7, 2024
1 parent 2a62907 commit 18a44a3
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,15 @@ export const sshPublicKeyValidationSchema = Yup.string().test(
},
);

export interface DiscoverySourceSetupModalProps {
isOpen?: boolean;
isDisabled?: boolean;
onClose: () => void;
onSubmit: (event: React.FormEvent<HTMLFormElement>) => void;
}

// Your component
export const DiscoverySourceSetupModal: React.FC<DiscoverySourceSetupModal.Props> = (props) => {
export const DiscoverySourceSetupModal: React.FC<DiscoverySourceSetupModalProps> = (props) => {
const { isOpen = false, isDisabled = false, onClose, onSubmit } = props;

const [sshKey, setSshKey] = useState("");
Expand Down

0 comments on commit 18a44a3

Please sign in to comment.