first commit
Some checks failed
Deploy / lint (push) Failing after 7s
Deploy / test (push) Has been skipped
Deploy / deploy (push) Has been skipped

This commit is contained in:
Dennis Thiessen
2026-02-20 17:31:01 +01:00
commit 61ab24490d
160 changed files with 17034 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
import { FormEvent, useState } from 'react';
import { useAddToWatchlist } from '../../hooks/useWatchlist';
export function AddTickerForm() {
const [symbol, setSymbol] = useState('');
const addMutation = useAddToWatchlist();
function handleSubmit(e: FormEvent) {
e.preventDefault();
const trimmed = symbol.trim().toUpperCase();
if (!trimmed) return;
addMutation.mutate(trimmed, { onSuccess: () => setSymbol('') });
}
return (
<form onSubmit={handleSubmit} className="flex gap-2">
<input
type="text"
value={symbol}
onChange={(e) => setSymbol(e.target.value)}
placeholder="Add symbol (e.g. AAPL)"
className="input-glass px-3 py-2 text-sm"
/>
<button
type="submit"
disabled={addMutation.isPending || !symbol.trim()}
className="btn-gradient px-4 py-2 text-sm disabled:opacity-50 disabled:cursor-not-allowed"
>
<span>{addMutation.isPending ? 'Adding…' : 'Add'}</span>
</button>
</form>
);
}