import React from "react";

export type FormContainerProps = {
  id: string;
  label: string;
  hideLabel?: boolean;
  required?: boolean;
  hideStar?: boolean;
  children: React.ReactNode;
};

const FormContainer = ({
  id,
  label,
  children,
  hideLabel,
  required,
  hideStar,
}: FormContainerProps) => {
  return (
    <div className="form-container">
      {!hideLabel && (
        <label
          className="block mb-2 font-medium text-gray-600 dark:text-gray-200"
          htmlFor={id}
        >
          {label}:
          {required && !hideStar && (
            <span className="text-xs text-red-700">*</span>
          )}
        </label>
      )}
      {children}
    </div>
  );
};

export default FormContainer;
