Skip to content

Commit bb75af5

Browse files
committed
Remove unused props from HomeInput component
Eliminated onInputSubmit and onQuickTaskSelect props from HomeInput and related model. Also removed the handleNewTask function and its usage in HomePage, as these props and logic are no longer needed.
1 parent 54fac3a commit bb75af5

File tree

3 files changed

+0
-64
lines changed

3 files changed

+0
-64
lines changed

src/frontend/src/components/content/HomeInput.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ const getIconFromString = (iconString: string | React.ReactNode): React.ReactNod
7373
};
7474

7575
const HomeInput: React.FC<HomeInputProps> = ({
76-
onInputSubmit,
77-
onQuickTaskSelect,
7876
selectedTeam,
7977
}) => {
8078
const [submitting, setSubmitting] = useState(false);

src/frontend/src/models/homeInput.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ export interface QuickTask {
66
}
77

88
export interface HomeInputProps {
9-
onInputSubmit: (input: string) => void;
10-
onQuickTaskSelect: (taskDescription: string) => void;
119
selectedTeam?: TeamConfig | null;
1210
}
1311

src/frontend/src/pages/HomePage.tsx

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -145,64 +145,6 @@ const HomePage: React.FC = () => {
145145
}
146146
}, [dispatchToast]);
147147

148-
/**
149-
* Handle new task creation from input submission
150-
* Creates a plan and navigates to the create plan page
151-
*/
152-
const handleNewTask = useCallback(async (taskName: string) => {
153-
if (taskName.trim()) {
154-
try {
155-
if (!selectedTeam) {
156-
console.log("it has no team");
157-
return;
158-
}
159-
const response = await TaskService.createPlan(
160-
taskName.trim(),
161-
selectedTeam?.team_id
162-
);
163-
164-
if (response.plan_id && response.plan_id !== null) {
165-
dispatchToast(
166-
<Toast>
167-
<ToastTitle>Plan Created!</ToastTitle>
168-
<ToastBody>
169-
Successfully created plan for: {taskName}
170-
{selectedTeam && ` using ${selectedTeam.name} team`}
171-
</ToastBody>
172-
</Toast>,
173-
{ intent: "success" }
174-
);
175-
176-
// Navigate to create page (no team ID in URL anymore)
177-
console.log('Navigating to plan creation with team:', selectedTeam?.name);
178-
navigate(`/plan/${response.plan_id}`);
179-
} else {
180-
dispatchToast(
181-
<Toast>
182-
<ToastTitle>
183-
<ErrorCircle20Regular />
184-
Failed to create plan
185-
</ToastTitle>
186-
<ToastBody>Unable to create plan. Please try again.</ToastBody>
187-
</Toast>,
188-
{ intent: "error" }
189-
);
190-
}
191-
} catch (error: any) {
192-
console.error('Error creating plan:', error);
193-
dispatchToast(
194-
<Toast>
195-
<ToastTitle>
196-
<ErrorCircle20Regular />
197-
Error creating plan
198-
</ToastTitle>
199-
<ToastBody>{error.message || 'Something went wrong'}</ToastBody>
200-
</Toast>,
201-
{ intent: "error" }
202-
);
203-
}
204-
}
205-
}, [navigate, dispatchToast, selectedTeam]);
206148

207149
return (
208150
<>
@@ -221,8 +163,6 @@ const HomePage: React.FC = () => {
221163
></ContentToolbar>
222164
{!isLoadingTeam ? (
223165
<HomeInput
224-
onInputSubmit={handleNewTask}
225-
onQuickTaskSelect={handleNewTask}
226166
selectedTeam={selectedTeam}
227167
/>
228168
) : (

0 commit comments

Comments
 (0)