"use client";

import { Control } from "react-hook-form";

import {
  WizardInputField,
  WizardTextareaField,
} from "@/components/providers/workflow/forms/fields";
import { ProviderCredentialFields } from "@/lib/provider-credentials/provider-credential-fields";

export const GitHubAppForm = ({ control }: { control: Control<any> }) => {
  return (
    <>
      <div className="flex flex-col">
        <div className="text-md text-text-neutral-primary leading-9 font-bold">
          Connect via GitHub App
        </div>
        <div className="text-text-neutral-tertiary text-sm">
          Please provide your GitHub App ID and private key.
        </div>
      </div>
      <WizardInputField
        control={control}
        name={ProviderCredentialFields.GITHUB_APP_ID}
        type="text"
        label="GitHub App ID"
        labelPlacement="inside"
        placeholder="Enter your GitHub App ID"
        variant="bordered"
        isRequired
      />
      <WizardTextareaField
        control={control}
        name={ProviderCredentialFields.GITHUB_APP_KEY}
        label="GitHub App Private Key"
        labelPlacement="inside"
        placeholder="Paste your GitHub App private key here"
        variant="bordered"
        isRequired
        minRows={4}
      />
    </>
  );
};
