PageSourceSearch

https://irantt.com/build/assets/index-DJ5dKGdP.js

js irantt.com collected 2026-10-06 21:41:20 UTC 8,101 bytes, 1 lines download raw bytes

1import{r as N,j as e,L as m,b}from"./app-Kls5WRdL.js";import{_ as t,f as c}from"./toast-provider-B31Yf0DI.js";import{B as i}from"./button-B2Ue9nKv.js";import{C as S}from"./card-FsObhJFp.js";import{B as d}from"./badge-LY2ETm95.js";import{T as z,a as B,C as F,A as v,b as w,c as y,d as C,e as D,f as _,g as A,h as T,i as O}from"./alert-dialog-C0PVifhF.js";import{A as L}from"./app-layout-BF7zmg-4.js";import{C as P}from"./clock-C6aIwKOd.js";import{C as E}from"./circle-alert-CahQI_WO.js";import{X as I}from"./x-fqlelf_C.js";import{T as k}from"./trash-2-nMlRFKfl.js";/* empty css            */import"./index-Dmpy5jNE.js";import"./index-B1mLQuam.js";import"./sheet-B0eIUY75.js";import"./index-CBYe1Dsg.js";import"./index-ByNxVBX_.js";import"./menu-BU2qgl7l.js";import"./index-DVKNPxYC.js";import"./index-9TX4buiG.js";import"./index-DmtsQYJc.js";import"./use-mobile-navigation-H586hQG-.js";import"./MobileBottomBar-D0DWz8b2.js";import"./gift-jJtKmooR.js";import"./chevron-right-BqMNQB46.js";import"./mode-toggle-vPsc58oG.js";import"./sun-D_CNYXY7.js";function he({futureOrders:s}){const[o,h]=N.useState(null),[x,u]=N.useState(null),l=a=>{switch(a){case"pending":return e.jsx(d,{variant:"outline",className:"bg-blue-50 text-blue-700 border-blue-200",children:t("Pending")});case"executed":return e.jsx(d,{className:"bg-green-500 text-white",children:t("Executed")});case"cancelled":return e.jsx(d,{variant:"secondary",className:"bg-gray-100 text-gray-700",children:t("Cancelled")});case"expired":return e.jsx(d,{variant:"destructive",className:"bg-orange-100 text-orange-700",children:t("Expired")});default:return e.jsx(d,{children:a})}},r=a=>{b.post(route("dashboard.future-orders.cancel",a),{},{onSuccess:()=>h(null)})},n=a=>{b.delete(route("dashboard.future-orders.destroy",a),{onSuccess:()=>u(null)})},g=s.data.filter(a=>a.status==="pending"),p=s.data.filter(a=>a.status==="executed"),j=s.data.filter(a=>a.status!=="pending"&&a.status!=="executed");return e.jsx(L,{title:t("Future Orders"),children:e.jsxs("div",{className:"mx-auto my-5 px-5 max-w-4xl",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h1",{className:"text-2xl font-bold",children:t("Future Orders")}),e.jsx(i,{asChild:!0,children:e.jsx(m,{href:route("dashboard.future-orders.create"),children:t("Create New Order")})})]}),s.data.length===0?e.jsxs(S,{className:"p-8 text-center",children:[e.jsx(P,{className:"w-12 h-12 mx-auto text-muted-foreground mb-4 opacity-50"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:t("No future orders yet")}),e.jsx(i,{asChild:!0,children:e.jsx(m,{href:route("dashboard.future-orders.create"),children:t("Create Your First Order")})})]}):e.jsxs("div",{className:"space-y-6",children:[g.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h2",{className:"text-lg font-semibold text-blue-600",children:[t("Active Orders")," (",g.length,")"]}),e.jsx("div",{className:"space-y-3",children:g.map(a=>e.jsx(f,{order:a,onCancel:()=>r(a.id),isCancelling:o===a.id,getStatusBadge:l},a.id))})]}),p.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h2",{className:"text-lg font-semibold text-green-600",children:[t("Executed Orders")," (",p.length,")"]}),e.jsx("div",{className:"space-y-3",children:p.map(a=>e.jsx(f,{order:a,onDelete:()=>n(a.id),isDeletingId:x,getStatusBadge:l},a.id))})]}),j.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-600",children:[t("Other Orders")," (",j.length,")"]}),e.jsx("div",{className:"space-y-3",children:j.map(a=>e.jsx(f,{order:a,onDelete:()=>n(a.id),isDeletingId:x,getStatusBadge:l},a.id))})]})]})]})})}function f({order:s,onCancel:o,isCancelling:h,onDelete:x,isDeletingId:u,getStatusBadge:l}){const r=s.trade_type==="buy",n=s.status==="pending";return e.jsx(S,{className:"p-4 hover:shadow-md transition-shadow",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[r?e.jsx(z,{className:"w-5 h-5 text-green-600"}):e.jsx(B,{className:"w-5 h-5 text-red-600"}),e.jsxs("div",{children:[e.jsxs("div",{className:"font-semibold text-sm",children:[r?t("Buy"):t("Sell")," ",c(r?s.gram:s.amount)," ",r?t("gram"):t("price symbol")]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[new Date(s.created_at).toLocaleDateString()," ",new Date(s.created_at).toLocaleTimeString()]})]})]}),l(s.status)]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 pt-2 border-t",children:[e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"text-muted-foreground text-xs",children:t("Target Price")}),e.jsx("div",{className:"font-semibold",children:c(s.target_price)})]}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"text-muted-foreground text-xs",children:t("Amount")}),e.jsxs("div",{className:"font-semibold",children:[c(s.amount)," ",t("price symbol")]})]})]}),s.tolerance_value&&e.jsxs("div",{className:"bg-blue-50 p-3 rounded text-sm text-blue-900 text-xs",children:[t("Tolerance"),": ±",c(s.tolerance_value)," ",s.tolerance_type==="percentage"?"%":t("price symbol")]}),s.status==="executed"&&e.jsxs("div",{className:"bg-green-50 p-3 rounded space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2 text-green-900 text-sm",children:[e.jsx(F,{className:"w-4 h-4"}),e.jsxs("span",{children:[t("Executed at")," ",c(s.execution_price)]})]}),s.trigger_reason&&e.jsxs("div",{className:"text-xs text-green-700 ml-6",children:[t("Reason"),": ",R(s.trigger_reason)]}),s.executed_at&&e.jsxs("div",{className:"text-xs text-green-700 ml-6",children:[new Date(s.executed_at).toLocaleDateString()," ",new Date(s.executed_at).toLocaleTimeString()]})]}),s.notes&&e.jsxs("div",{className:"bg-gray-50 p-3 rounded text-gray-700 text-xs italic",children:['"',s.notes,'"']}),s.expires_at&&new Date(s.expires_at)<new Date&&s.status==="pending"&&e.jsxs("div",{className:"bg-orange-50 p-3 rounded flex items-center gap-2 text-orange-900 text-sm",children:[e.jsx(E,{className:"w-4 h-4 shrink-0"}),e.jsx("span",{children:t("This order has expired")})]}),n&&e.jsxs("div",{className:"flex gap-2 pt-2 border-t",children:[e.jsx(i,{asChild:!0,variant:"ghost",size:"sm",className:"flex-1",children:e.jsx(m,{href:route("dashboard.future-orders.show",s.id),children:t("View Details")})}),e.jsxs(v,{children:[e.jsx(w,{asChild:!0,children:e.jsxs(i,{variant:"destructive",size:"sm",className:"flex-1 items-center",disabled:h,children:[e.jsx(I,{className:"w-4 h-4 mr-2"}),t("Cancel")]})}),e.jsxs(y,{children:[e.jsxs(C,{children:[e.jsx(D,{children:t("Cancel Future Order?")}),e.jsx(_,{children:t("Are you sure you want to cancel this future order? This action cannot be undone.")})]}),e.jsxs(A,{children:[e.jsx(T,{children:t("Keep Order")}),e.jsx(O,{onClick:()=>o(),className:"bg-destructive text-white hover:bg-destructive/90",children:t("Cancel Order")})]})]})]})]}),!n&&e.jsxs("div",{className:"flex gap-2 pt-2 border-t",children:[e.jsx(i,{asChild:!0,variant:"ghost",size:"sm",className:"flex-1",children:e.jsx(m,{href:route("dashboard.future-orders.show",s.id),children:t("View Details")})}),e.jsxs(v,{children:[e.jsx(w,{asChild:!0,children:e.jsx(i,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive hover:bg-destructive/10",disabled:u===s.id,children:e.jsx(k,{className:"w-4 h-4"})})}),e.jsxs(y,{dir:"rtl",children:[e.jsxs(C,{children:[e.jsx(D,{children:t("Delete Future Order?")}),e.jsx(_,{children:t("Are you sure you want to delete this order? This action cannot be undone.")})]}),e.jsxs(A,{children:[e.jsx(T,{children:t("Keep")}),e.jsx(O,{onClick:()=>x(),className:"bg-destructive text-white hover:bg-destructive/90",children:t("Delete")})]})]})]})]})]})})}function R(s){return{exact_match:"Exact price match",touched_zone:"Price touched target zone",crossed_zone:"Price crossed into target zone",gapped_down:"Price gapped down to target",ga
1pped_up:"Price gapped up to target",within_tolerance:"Price within tolerance zone"}[s]||s}export{he as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.