+// {!conversationStarted ? (
+//
+// {/* Conversation History */}
+//
+// {conversationHistory.map((message, index) => (
+//
+// {message.type === "assistant" && (
+// //
+//
+// )}
+//
"),
+// }}
+// />
+//
+// ))}
+//
+
+// {summaryPresented && !finalizeSummary && (
+//
+// {
+// setUserInput(
+// "Looks good to me. I accept this summary.",
+// );
+
+// const message =
+// "Looks good to me. I accept this summary.";
+
+// const updatedHistory = [
+// ...conversationHistory,
+// { type: "user" as const, content: message },
+// ];
+// setConversationHistory(updatedHistory);
+
+// try {
+// console.log(
+// "Automatically sending acceptance message",
+// );
+// // Get AI analysis with full conversation context
+// const analysis =
+// await analyzeRoleMutation.mutateAsync({
+// status: "FINAL",
+// currentMessage: message,
+// history: updatedHistory,
+// });
+
+// console.log(
+// "Analysis response for automatic acceptance:",
+// analysis,
+// );
+
+// if (analysis.analysis === "" && summaryPresented) {
+// const updatedSuggestions = {
+// role: analysis.suggestedRole || suggestions.role,
+// experience:
+// analysis.suggestedExperience ||
+// suggestions.experience,
+// responsibilities:
+// analysis.suggestedResponsibilities ||
+// suggestions.responsibilities,
+// marketRate:
+// analysis.marketRate || suggestions.marketRate,
+// location:
+// analysis.suggestedLocation ||
+// suggestions.location,
+// };
+// setSuggestions(updatedSuggestions);
+
+// // Set form values
+// formik.resetForm({
+// role: updatedSuggestions.role,
+// experience: updatedSuggestions.experience,
+// responsibilities:
+// updatedSuggestions.responsibilities || [],
+// marketRate: updatedSuggestions.marketRate || 0,
+// industry: "web3",
+// commitmentLevel: 40,
+// fiatAmount: 0,
+// username: "",
+// name: "",
+// location: updatedSuggestions.location || "Remote",
+// });
+
+// setFinalizeSummary(true);
+// setShowForm(true);
+
+// // Force validation to run
+// // setTimeout(() => {
+// // form.trigger();
+// // }, 100);
+
+// return;
+// }
+
+// // Add AI response to history if there is one
+// if (analysis.analysis) {
+// setConversationHistory((prev) => [
+// ...prev,
+// {
+// type: "assistant" as const,
+// content: analysis.analysis,
+// },
+// ]);
+// }
+
+// // Update suggestions if provided
+// if (
+// analysis.suggestedRole ||
+// analysis.suggestedExperience ||
+// analysis.suggestedResponsibilities ||
+// analysis.marketRate ||
+// analysis.suggestedLocation
+// ) {
+// setSuggestions((prev) => ({
+// ...prev,
+// role: analysis.suggestedRole || prev.role,
+// experience:
+// analysis.suggestedExperience || prev.experience,
+// responsibilities:
+// analysis.suggestedResponsibilities ||
+// prev.responsibilities,
+// marketRate:
+// analysis.marketRate || prev.marketRate,
+// location:
+// analysis.suggestedLocation || prev.location,
+// }));
+// }
+// } catch (error) {
+// console.error(
+// "Error processing automatic acceptance:",
+// error,
+// );
+// handleError({
+// title: "Error",
+// description:
+// "Failed to process your acceptance. Please try again.",
+// variant: "destructive",
+// });
+// }
+
+// // Clear the input
+// setUserInput("");
+// }}
+// >
+// {/* */}
+// Accept Summary
+//
+// {
+// setUserInput(
+// "I'd like to refine some aspects of this agreement.",
+// );
+// handleSubmitMessage();
+// }}
+// >
+// {/* */}
+// Refine Details
+//
+//
+// )}
+
+// {/* Input Area */}
+// {(!summaryPresented ||
+// (summaryPresented && !finalizeSummary)) && (
+//
+//
+// )}
+
+// {showForm && finalizeSummary && (
+//
+//
+// Review Your Agreement
+//
+// You've accepted the role summary. Please complete the
+// following details to finalize your agreement.
+//
+//
+//
+//
+//
Role Summary
+//
+// Role: {suggestions.role}
+//
+//
+// Experience: {suggestions.experience}
+//
+//
+// Location: {suggestions.location || "Remote"}
+//
+//
+// Market Rate: ${suggestions.marketRate}/month
+//
+//
+// Responsibilities:
+//
+//
+// {suggestions.responsibilities?.map((resp, i) => (
+// {resp}
+// ))}
+//
+//
+
+// {/* The Form */}
+//
+//
+//
+//
+
+//
+//
+//
+
+//
+//
+//
+
+//
+//
{
+// if (!formik.isValid) {
+// // show toasts for top‐level errors
+// if (formik.errors.username) {
+// handleErrorMessage({
+// title: "Missing information",
+// description: formik.errors.username,
+// variant: "destructive",
+// });
+// }
+// if (formik.errors.commitmentLevel) {
+// handleErrorMessage({
+// title: "Invalid commitment",
+// description: formik.errors.commitmentLevel,
+// variant: "destructive",
+// });
+// }
+// return;
+// }
+// formik.handleSubmit();
+// }}
+// disabled={createAgreementMutation.isPending}
+// className="w-full"
+// >
+// {createAgreementMutation.isPending && (
+//
+// )}
+// Create Agreement
+//
+
+//
+// Having trouble? Make sure all fields are filled out correctly.
+//
+//
+//
+//
+//
+// )}
+//