Add Geographic Region Location designation (United States, Connecticut, Global) tag editor & quick dropdown filters
This commit is contained in:
@@ -36,6 +36,21 @@ export const AutonomousEngine: React.FC<AutonomousEngineProps> = ({
|
||||
const [criteria, setCriteria] = useState(userProfile.autoApplyCriteria);
|
||||
const [targetRoleInput, setTargetRoleInput] = useState('');
|
||||
const [excludedCompanyInput, setExcludedCompanyInput] = useState('');
|
||||
const [locationInput, setLocationInput] = useState('');
|
||||
|
||||
const handleAddLocation = () => {
|
||||
if (!locationInput.trim()) return;
|
||||
const currentLocs = criteria.preferredLocations || [];
|
||||
const updated = [...currentLocs, locationInput.trim()];
|
||||
handleUpdateCriteria('preferredLocations', updated);
|
||||
setLocationInput('');
|
||||
};
|
||||
|
||||
const handleRemoveLocation = (loc: string) => {
|
||||
const currentLocs = criteria.preferredLocations || [];
|
||||
const updated = currentLocs.filter(l => l !== loc);
|
||||
handleUpdateCriteria('preferredLocations', updated);
|
||||
};
|
||||
|
||||
const [logs, setLogs] = useState<{ id: string; time: string; msg: string; type: 'info' | 'success' | 'warning' }[]>([
|
||||
{ id: '1', time: '10:15 AM', msg: 'Autonomous AI Daemon initialized with Gemini 3.6 Flash.', type: 'info' },
|
||||
@@ -248,9 +263,39 @@ export const AutonomousEngine: React.FC<AutonomousEngineProps> = ({
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Preferred Locations & Work Type (Remote / Hybrid / Onsite) */}
|
||||
{/* Preferred Work Locations Tags */}
|
||||
<div>
|
||||
<label className="block text-xs font-semibold text-slate-300 mb-1.5">Preferred Work Locations & Remote Status</label>
|
||||
<label className="block text-xs font-semibold text-slate-300 mb-1.5">Designated Target Locations & Regions</label>
|
||||
<div className="flex gap-2 mb-2">
|
||||
<input
|
||||
type="text"
|
||||
placeholder="e.g. United States, Connecticut, Remote US"
|
||||
value={locationInput}
|
||||
onChange={(e) => setLocationInput(e.target.value)}
|
||||
className="flex-1 px-3 py-1.5 rounded-xl bg-slate-950 border border-slate-800 text-slate-200 text-xs focus:outline-none focus:border-indigo-500"
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
onClick={handleAddLocation}
|
||||
className="px-3 py-1.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-200 text-xs font-semibold"
|
||||
>
|
||||
Add Location
|
||||
</button>
|
||||
</div>
|
||||
<div className="flex flex-wrap gap-1.5 mb-2">
|
||||
{(criteria.preferredLocations || []).map((loc, idx) => (
|
||||
<span key={idx} className="px-2.5 py-1 rounded-lg bg-blue-950/80 text-blue-300 border border-blue-500/30 text-xs flex items-center gap-1.5">
|
||||
<MapPin className="w-3 h-3 text-blue-400" />
|
||||
{loc}
|
||||
<button type="button" onClick={() => handleRemoveLocation(loc)} className="hover:text-white ml-1">✕</button>
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Preferred Work Type (Remote / Hybrid / Onsite) */}
|
||||
<div>
|
||||
<label className="block text-xs font-semibold text-slate-300 mb-1.5">Preferred Work Environment</label>
|
||||
<div className="flex items-center gap-3 text-xs mb-2">
|
||||
{['Remote', 'Hybrid', 'Onsite'].map((type) => {
|
||||
const workTypes = criteria.preferredWorkTypes || ['Remote', 'Hybrid'];
|
||||
|
||||
@@ -25,9 +25,9 @@ export const JobFeeds: React.FC<JobFeedsProps> = ({
|
||||
onTailorJobFeed,
|
||||
onQuickApplyFeed
|
||||
}) => {
|
||||
const [searchTerm, setSearchTerm] = useState('');
|
||||
const [selectedPlatform, setSelectedPlatform] = useState<string>('ALL');
|
||||
const [selectedWorkType, setSelectedWorkType] = useState<string>('ALL');
|
||||
const [selectedLocationFilter, setSelectedLocationFilter] = useState<string>('ALL');
|
||||
const [minMatch, setMinMatch] = useState<number>(0);
|
||||
const [appliedFeedIds, setAppliedFeedIds] = useState<string[]>([]);
|
||||
const [isFetchingFeeds, setIsFetchingFeeds] = useState(false);
|
||||
@@ -67,9 +67,19 @@ export const JobFeeds: React.FC<JobFeedsProps> = ({
|
||||
matchesWorkType = !feedLoc.includes('remote') && !feedDesc.includes('remote');
|
||||
}
|
||||
|
||||
// Specific Location Region Filter (United States, Connecticut, Global)
|
||||
let matchesRegionLocation = true;
|
||||
if (selectedLocationFilter === 'US') {
|
||||
matchesRegionLocation = feedLoc.includes('us') || feedLoc.includes('united states') || feedLoc.includes('remote us') || feedDesc.includes('united states');
|
||||
} else if (selectedLocationFilter === 'CT') {
|
||||
matchesRegionLocation = feedLoc.includes('ct') || feedLoc.includes('connecticut') || feedDesc.includes('connecticut');
|
||||
} else if (selectedLocationFilter === 'GLOBAL') {
|
||||
matchesRegionLocation = feedLoc.includes('global') || feedLoc.includes('worldwide') || feedLoc.includes('international');
|
||||
}
|
||||
|
||||
const matchesMatch = (feed.estimatedMatch ?? 80) >= minMatch;
|
||||
|
||||
return matchesSearch && matchesPlatform && matchesWorkType && matchesMatch;
|
||||
return matchesSearch && matchesPlatform && matchesWorkType && matchesRegionLocation && matchesMatch;
|
||||
});
|
||||
|
||||
const handleFetchLiveFeeds = async () => {
|
||||
@@ -141,6 +151,18 @@ export const JobFeeds: React.FC<JobFeedsProps> = ({
|
||||
{/* Platform & Work Type & Match Threshold */}
|
||||
<div className="flex items-center flex-wrap gap-2.5 text-xs">
|
||||
|
||||
{/* Location Region Filter Dropdown */}
|
||||
<select
|
||||
value={selectedLocationFilter}
|
||||
onChange={(e) => setSelectedLocationFilter(e.target.value)}
|
||||
className="px-3 py-2 rounded-xl bg-slate-950 border border-slate-800 text-blue-300 font-semibold text-xs focus:outline-none focus:border-indigo-500"
|
||||
>
|
||||
<option value="ALL">All Regions & Locations</option>
|
||||
<option value="US">🇺🇸 United States / Remote US</option>
|
||||
<option value="CT">🏛️ Connecticut (CT)</option>
|
||||
<option value="GLOBAL">🌍 Global / International</option>
|
||||
</select>
|
||||
|
||||
{/* Work Type Filter Dropdown */}
|
||||
<select
|
||||
value={selectedWorkType}
|
||||
@@ -181,12 +203,13 @@ export const JobFeeds: React.FC<JobFeedsProps> = ({
|
||||
/>
|
||||
</div>
|
||||
|
||||
{(searchTerm || selectedPlatform !== 'ALL' || selectedWorkType !== 'ALL' || minMatch > 0) && (
|
||||
{(searchTerm || selectedPlatform !== 'ALL' || selectedWorkType !== 'ALL' || selectedLocationFilter !== 'ALL' || minMatch > 0) && (
|
||||
<button
|
||||
onClick={() => {
|
||||
setSearchTerm('');
|
||||
setSelectedPlatform('ALL');
|
||||
setSelectedWorkType('ALL');
|
||||
setSelectedLocationFilter('ALL');
|
||||
setMinMatch(0);
|
||||
}}
|
||||
className="px-3 py-2 rounded-xl bg-indigo-950 border border-indigo-500/40 text-indigo-300 text-xs font-semibold hover:bg-indigo-900 transition"
|
||||
|
||||
Reference in New Issue
Block a user