From f08e69fd137271af6f270bb77393dcb7ff814654 Mon Sep 17 00:00:00 2001 From: arsam Date: Fri, 18 Sep 2026 23:25:17 +0330 Subject: [PATCH] Import source: app/src/pages/JobsPage Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality. --- app/src/pages/JobsPage.jsx | 64 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 app/src/pages/JobsPage.jsx diff --git a/app/src/pages/JobsPage.jsx b/app/src/pages/JobsPage.jsx new file mode 100644 index 0000000..c483cdc --- /dev/null +++ b/app/src/pages/JobsPage.jsx @@ -0,0 +1,64 @@ +import { useState, useEffect } from 'react'; +import { useToast, EmptyState, inputStyle, pillBtn } from '../../teknav-ui.jsx'; +import { contentApi } from '../../src/lib/content-api.js'; + +export function JobsPage() { + const toast = useToast(); + const [items, setItems] = useState([]); + const [form, setForm] = useState({ company: '', title: '', location: 'Remote', remote: true, url: '', contactEmail: '', description: '' }); + const [busy, setBusy] = useState(false); + useEffect(() => { + contentApi.listJobs().then(setItems).catch(() => setItems([])); + }, []); + const set = (key, value) => setForm((current) => ({ ...current, [key]: value })); + const submit = async (event) => { + event.preventDefault(); + setBusy(true); + try { + await contentApi.submitJob(form); + setForm({ company: '', title: '', location: 'Remote', remote: true, url: '', contactEmail: '', description: '' }); + toast('آگهی شغلی برای بررسی ارسال شد'); + } catch { + toast('ارسال آگهی ناموفق بود', 'error'); + } finally { + setBusy(false); + } + }; + return ( +
+
+

فرصت‌های شغلی فناوری

+

جایگاه‌های منتخب شرکت‌های فنی فارسی‌زبان. آگهی‌های جدید بعد از بررسی تحریریه منتشر می‌شوند.

+
+
+ {items.length === 0 ? : items.map((job) => ( + + ))} +
+
+

ثبت آگهی شرکت

+ set('company', e.target.value)} placeholder="نام شرکت" style={inputStyle} /> + set('title', e.target.value)} placeholder="عنوان شغل" style={inputStyle} /> + set('location', e.target.value)} placeholder="موقعیت" style={inputStyle} /> + set('contactEmail', e.target.value)} placeholder="ایمیل تماس" style={inputStyle} dir="ltr" /> + set('url', e.target.value)} placeholder="لینک درخواست" style={inputStyle} dir="ltr" /> + +