import { useWalkthroughForm } from '@/business/walkthrough/formHooks';
import { WalkthroughFormView } from '@/components/walkthrough-form/WalkthroughFormView';
import type { WalkthroughCheckinCreateDto } from '@/shared/types/walkthrough';

interface WalkThroughFormProps {
  onSubmit: (data: WalkthroughCheckinCreateDto) => Promise<void>;
  submitting: boolean;
  userName: string;
}

const WalkThroughForm = ({ onSubmit, submitting, userName }: WalkThroughFormProps) => {
  const workflow = useWalkthroughForm({ userName, onSubmit });

  return (
    <WalkthroughFormView
      state={workflow.state}
      actions={workflow.actions}
      submitting={submitting}
    />
  );
};

export default WalkThroughForm;
