Files
igny8/frontend/dist/assets/js/SeedKeywords-Csm_woDL.js
IGNY8 VPS (Salman) 3c100be1cf more
2025-11-13 14:12:36 +00:00

2 lines
3.4 KiB
JavaScript

import{r as s,j as e}from"./chunk-UIGDSWPH-BhuNDbxn.js";import{u as p,ah as u,s as f,P as j}from"./main-af3pcbZa.js";import{C as N}from"./Card-CAsJMMfR.js";import{B as b}from"./Badge-DM3morB7.js";function I(){const d=p(),[x,i]=s.useState([]),[c,n]=s.useState([]),[o,l]=s.useState(!0),[r,m]=s.useState(null),[a,y]=s.useState("");s.useEffect(()=>{h(),g()},[r,a]);const h=async()=>{try{const t=await u();n(t.industries||[])}catch(t){d.error(`Failed to load industries: ${t.message}`)}},g=async()=>{try{l(!0);const t=await f({industry:r||void 0,search:a||void 0});i(t.results||[])}catch(t){d.error(`Failed to load seed keywords: ${t.message}`)}finally{l(!1)}};return e.jsxs("div",{className:"p-6",children:[e.jsx(j,{title:"Seed Keywords"}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Seed Keywords"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mt-1",children:"Global keyword library for reference"})]}),e.jsxs("div",{className:"mb-6 flex gap-4",children:[e.jsxs("select",{className:"px-4 py-2 border border-gray-300 dark:border-gray-700 rounded-lg bg-white dark:bg-gray-800",value:r||"",onChange:t=>m(t.target.value?parseInt(t.target.value):null),children:[e.jsx("option",{value:"",children:"All Industries"}),c.map(t=>e.jsx("option",{value:t.id,children:t.name},t.id))]}),e.jsx("input",{type:"text",placeholder:"Search keywords...",className:"flex-1 px-4 py-2 border border-gray-300 dark:border-gray-700 rounded-lg bg-white dark:bg-gray-800",value:a,onChange:t=>y(t.target.value)})]}),o?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("div",{className:"text-gray-500",children:"Loading..."})}):e.jsx(N,{className:"p-6",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-200 dark:border-gray-700",children:[e.jsx("th",{className:"text-left py-3 px-4 text-sm font-medium text-gray-700 dark:text-gray-300",children:"Keyword"}),e.jsx("th",{className:"text-left py-3 px-4 text-sm font-medium text-gray-700 dark:text-gray-300",children:"Industry"}),e.jsx("th",{className:"text-left py-3 px-4 text-sm font-medium text-gray-700 dark:text-gray-300",children:"Sector"}),e.jsx("th",{className:"text-left py-3 px-4 text-sm font-medium text-gray-700 dark:text-gray-300",children:"Volume"}),e.jsx("th",{className:"text-left py-3 px-4 text-sm font-medium text-gray-700 dark:text-gray-300",children:"Difficulty"}),e.jsx("th",{className:"text-left py-3 px-4 text-sm font-medium text-gray-700 dark:text-gray-300",children:"Intent"})]})}),e.jsx("tbody",{children:x.map(t=>e.jsxs("tr",{className:"border-b border-gray-100 dark:border-gray-800",children:[e.jsx("td",{className:"py-3 px-4 text-sm font-medium text-gray-900 dark:text-white",children:t.keyword}),e.jsx("td",{className:"py-3 px-4 text-sm text-gray-600 dark:text-gray-400",children:t.industry_name}),e.jsx("td",{className:"py-3 px-4 text-sm text-gray-600 dark:text-gray-400",children:t.sector_name}),e.jsx("td",{className:"py-3 px-4 text-sm text-gray-900 dark:text-white",children:t.volume.toLocaleString()}),e.jsx("td",{className:"py-3 px-4 text-sm text-gray-900 dark:text-white",children:t.difficulty}),e.jsx("td",{className:"py-3 px-4",children:e.jsx(b,{variant:"light",color:"primary",children:t.intent_display})})]},t.id))})]})})})]})}export{I as default};