PageSourceSearch

https://bublitz-einrichtungen.de/_next/static/chunks/pages/inventar/[uuid]/dashboard-8a2212805298dca3.js

js bublitz-einrichtungen.de collected 2026-10-06 16:16:22 UTC 33,961 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8434],{47772:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/inventar/[uuid]/dashboard",function(){return s(54734)}])},54734:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>f});var a=s(37876),r=s(14232),l=s(54587),i=s.n(l),n=s(89099),c=s(77328),d=s.n(c),o=s(30116),m=s(96141);function x(e){let t=function(e){let t=(e||"").toLowerCase();return t.includes("chair")||t.includes("stuhl")?"chair":t.includes("desk")||t.includes("tisch")?"desk":t.includes("stor")?"storage":t.includes("light")||t.includes("beleucht")?"lighting":"other"}(e.category),s=[];if(e.photos_json)try{s=JSON.parse(e.photos_json).map(e=>e.data||e.url).filter(Boolean)}catch(e){}return{id:e.uuid,qrCode:e.qr_code||"",category:t,manufacturer:e.manufacturer||"",model:e.model||"",serialNumber:e.serial_number||"",purchaseDate:e.purchase_date||"",purchasePrice:Number(e.purchase_price||0),supplier:e.supplier||"",location:{building:e.location_building||"",floor:e.location_floor||"",room:e.location_room||"",workstation:e.location_workstation||"",employee:e.employee_assigned||void 0},condition:{rating:Number(e.condition_rating||0),lastInspection:e.last_maintenance||"",issues:[],photos:s},warranty:{endDate:e.warranty_end_date||"",provider:"",coverage:""},sustainability:{co2Footprint:0,recyclable:!0,reusable:!0,disposalCost:0},notes:e.notes||""}}async function h(e){return new Promise((t,s)=>{let a=new FileReader;a.onload=()=>t(String(a.result)),a.onerror=s,a.readAsDataURL(e)})}let u=e=>{let{companyUuid:t,itemUuid:s}=e,[l,i]=(0,r.useState)([]);return(0,r.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/inventory/".concat(t,"/items/").concat(s,"/events"));e.ok&&i(await e.json())}catch(e){}})()},[t,s]),(0,a.jsx)("div",{className:"border rounded p-3 max-h-48 overflow-auto text-sm",children:0===l.length?(0,a.jsx)("p",{className:"text-gray-500",children:"Keine Eintr\xe4ge"}):l.map((e,t)=>(0,a.jsxs)("div",{className:"py-1 border-b last:border-b-0",children:[(0,a.jsx)("span",{className:"font-medium mr-2",children:e.type}),(0,a.jsx)("span",{className:"text-gray-600",children:e.performed_at||e.created_at?new Date(e.performed_at||e.created_at).toLocaleString("de-DE"):"-"})]},t))})},p=e=>{let{companyUuid:t,itemUuid:s,onSaved:l}=e,[i,n]=(0,r.useState)("inspection"),[c,d]=(0,r.useState)("");return(0,a.jsxs)("div",{className:"mt-2 flex gap-2",children:[(0,a.jsxs)("select",{className:"border rounded px-2 py-1",value:i,onChange:e=>n(e.target.value),children:[(0,a.jsx)("option",{value:"inspection",children:"Inspektion"}),(0,a.jsx)("option",{value:"move",children:"Umzug"}),(0,a.jsx)("option",{value:"note",children:"Notiz"})]}),(0,a.jsx)("input",{className:"border rounded px-2 py-1 flex-1",placeholder:"Notiz (optional)",value:c,onChange:e=>d(e.target.value)}),(0,a.jsx)(o.A,{text:"Hinzuf\xfcgen",variant:"outline",onClick:async()=>{try{let e={type:i,data_json:c?JSON.stringify({note:c}):null};(await fetch("/api/inventory/".concat(t,"/items/").concat(s,"/events"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&l&&l()}catch(e){}}})]})},g=e=>{let{companyUuid:t,itemUuid:s}=e,[l,i]=(0,r.useState)([]);return(0,r.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/inventory/".concat(t,"/items/").concat(s,"/issues"));e.ok&&i(await e.json())}catch(e){}})()},[t,s]),(0,a.jsx)("div",{className:"border rounded p-3 max-h-48 overflow-auto text-sm",children:0===l.length?(0,a.jsx)("p",{className:"text-gray-500",children:"Keine M\xe4ngel"}):l.map((e,t)=>(0,a.jsxs)("div",{className:"py-1 border-b last:border-b-0",children:[(0,a.jsx)("span",{className:"font-medium mr-2",children:e.title}),(0,a.jsx)("span",{className:"text-gray-600",children:e.status})]},t))})},j=e=>{let{companyUuid:t,itemUuid:s,onSaved:l}=e,[i,n]=(0,r.useState)(""),[c,d]=(0,r.useState)("");return(0,a.jsxs)("div",{className:"mt-2 flex gap-2",children:[(0,a.jsx)("input",{className:"border rounded px-2 py-1 flex-1",placeholder:"Titel",value:i,onChange:e=>n(e.target.value)}),(0,a.jsx)("input",{className:"border rounded px-2 py-1 flex-1",placeholder:"Beschreibung",value:c,onChange:e=>d(e.target.value)}),(0,a.jsx)(o.A,{text:"Melden",variant:"outline",onClick:async()=>{try{if(!i)return;(await fetch("/api/inventory/".concat(t,"/items/").concat(s,"/issues"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:i,description:c||null,severity:"medium"})})).ok&&l&&l(),n(""),d("")}catch(e){}}})]})},f=()=>{let{uuid:e}=(0,n.useRouter)().query,[t,s]=(0,r.useState)("overview"),[l,c]=(0,r.useState)([]),[f,y]=(0,r.useState)(!1),[v,N]=(0,r.useState)(null),[b,w]=(0,r.useState)(!1),[k,S]=(0,r.useState)(!1),[C,L]=(0,r.useState)(null),[_,D]=(0,r.useState)(""),[M,E]=(0,r.useState)(""),[I,B]=(0,r.useState)(""),[A,O]=(0,r.useState)(null),[R,U]=(0,r.useState)(!1);(0,r.useEffect)(()=>{(async()=>
1{if(e&&"string"==typeof e){S(!0),L(null);try{let t=new URLSearchParams;_&&t.set("q",_),M&&t.set("category",M),I&&t.set("status",I);let s=await fetch("/api/inventory/".concat(e,"/items?").concat(t.toString()));if(!s.ok)throw Error("Fehler beim Laden des Inventars");let a=await s.json();c(a.map(x))}catch(e){L((0,m.u1)(e))}finally{S(!1)}}})()},[e,_,M,I]);let z=(0,r.useMemo)(()=>{let e=_.trim().toLowerCase();return l.filter(t=>{let s=!e||[t.id,t.manufacturer,t.model,t.serialNumber,t.location.room,t.location.employee||""].filter(Boolean).some(t=>String(t).toLowerCase().includes(e)),a=!M||t.category===M;return s&&a})},[l,_,M]),[T,F]=(0,r.useState)({category:"",manufacturer:"",model:"",serialNumber:"",building:"",floor:"",room:"",workstation:"",photo:null}),P=()=>{let t=new Blob([[["ID","QR-Code","Kategorie","Hersteller","Modell","Seriennummer","Kaufdatum","Preis","Standort","Zustand"],...l.map(e=>[e.id,e.qrCode,q[e.category],e.manufacturer,e.model,e.serialNumber,e.purchaseDate,e.purchasePrice,"".concat(e.location.room,", ").concat(e.location.workstation),e.condition.rating])].map(e=>e.join(",")).join("\n")],{type:"text/csv;charset=utf-8;"}),s=document.createElement("a");s.href=URL.createObjectURL(t),s.download="inventar_".concat(e,"_").concat(new Date().toISOString().split("T")[0],".csv"),s.click()},J=e=>{let t="BUBLITZ-INV:".concat(e.id,"|").concat(e.manufacturer,"|").concat(e.model,"|").concat(e.serialNumber);return"https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=".concat(encodeURIComponent(t))},W={desk:"\uD83E\uDE91",chair:"\uD83D\uDCBA",storage:"\uD83D\uDDC4️",lighting:"\uD83D\uDCA1",other:"\uD83D\uDCE6"},q={desk:"Schreibtisch",chair:"B\xfcrostuhl",storage:"Stauraum",lighting:"Beleuchtung",other:"Sonstiges"};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(d(),{children:[(0,a.jsx)("title",{children:"Inventar Dashboard | BUBLITZ M\xf6bel-Inventar System"}),(0,a.jsx)("meta",{name:"robots",content:"noindex, nofollow"})]}),(0,a.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[(0,a.jsx)("div",{className:"bg-white shadow",children:(0,a.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,a.jsxs)("div",{className:"flex justify-between items-center py-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-3xl font-bold text-gray-900",children:"M\xf6bel-Inventar"}),(0,a.jsxs)("p",{className:"mt-1 text-sm text-gray-600",children:[e," - Digitale M\xf6belverwaltung"]})]}),(0,a.jsxs)("div",{className:"flex gap-4",children:[(0,a.jsx)(o.A,{text:"QR-Codes drucken",variant:"outline",onClick:()=>y(!0)}),(0,a.jsx)(o.A,{text:"Excel Export",variant:"outline",onClick:()=>P()}),(0,a.jsx)(o.A,{text:"Neues M\xf6belst\xfcck",variant:"primary",onClick:()=>s("add")})]})]})})}),(0,a.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mt-8",children:(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow p-1 inline-flex",children:[(0,a.jsx)("button",{onClick:()=>s("overview"),className:"px-4 py-2 rounded-md font-medium transition-colors ".concat("overview"===t?"bg-primary text-white":"text-gray-700 hover:text-gray-900"),children:"\xdcbersicht"}),(0,a.jsx)("button",{onClick:()=>s("list"),className:"px-4 py-2 rounded-md font-medium transition-colors ".concat("list"===t?"bg-primary text-white":"text-gray-700 hover:text-gray-900"),children:"Inventarliste"}),(0,a.jsx)("button",{onClick:()=>s("add"),className:"px-4 py-2 rounded-md font-medium transition-colors ".concat("add"===t?"bg-primary text-white":"text-gray-700 hover:text-gray-900"),children:"Erfassen"})]})}),"list"===t&&(0,a.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mt-6 flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,a.jsx)("input",{type:"text",placeholder:"Suche nach Inventargegenst\xe4nden...",className:"w-full md:w-1/2 px-3 py-2 border rounded-lg",value:_,onChange:e=>D(e.target.value)}),(0,a.jsxs)("div",{className:"flex gap-3 items-center",children:[(0,a.jsxs)("select",{className:"px-3 py-2 border rounded-lg",value:M,onChange:e=>E(e.target.value),children:[(0,a.jsx)("option",{value:"",children:"Alle Kategorien"}),(0,a.jsx)("option",{value:"desk",children:"Schreibtisch"}),(0,a.jsx)("option",{value:"chair",children:"B\xfcrostuhl"}),(0,a.jsx)("option",{value:"storage",children:"Stauraum"}),(0,a.jsx)("option",{value:"lighting",children:"Beleuchtung"}),(0,a.jsx)("option",{value:"other",children:"Sonstiges"})]}),(0,a.jsx)(o.A,{text:"CSV Export",variant:"outline",onClick:P}),(0,a.jsx)(o.A,{text:"JSON Export",variant:"outline",onClick:()=>{e&&"string"==typeof e&&window.open("/api/inventory/".concat(e,"/export"),"_blank")}}),(0,a.jsx)("input",{type:"file",accept:"application/json",onChange:e=>{var t;return O((null==(t=e.target.files)?void 0:t[0])||null)}}),(0,a.jsxs)("label",{className:"text-sm text-gray-600 inline-flex items-center gap-1",children:[(0,a.jsx)("input",{type:"checkbox",checked:R,onChange:e=>U(e.target.checked)}),"Ersetzen"]}),(0,a.jsx)(o.A,{text:"JSON Import",variant:"outline",onClick:async()=>{try{if(!e||"string"!=typeof e||!A)return;let t=await A.text(),s=JSON.parse(t);if(!(await fetch("/api/inventory/".concat(e,"/import"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...s,replace:R})})).ok)throw Error("Import fehlgeschlagen");let a=await fetch("/api/inventory/".concat(e,"/items"));if(a.ok){let e=await a.json();c(e.map(x))}alert("Import erfolgreich")}catch(e){alert("Import fehlgeschlagen")}}})]})]}),(0,a.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:["overview"===t&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-4 mb-8",children:[(0,a.jsx)("div",{className:"bg-white overflow-hidden shadow rounded-lg",children:(0,a.jsx)("div",{className:"p-5",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("div",{className:"flex-shrink-0",children:(0,a.jsx)("svg",{className:"h-6 w-6 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})})}),(0,a.jsx)("div",{className:"ml-5 w-0 flex-1",children:(0,a.jsxs)("dl",{children:[(0,a.jsx)("dt",{className:"text-sm font-medium text-gray-500 truncate",children:"Gesamt-Inventar"}),(0,a.jsx)("dd",{className:"text-lg font-medium text-gray-900",children:l.length})]})})]})})}),(0,a.jsx)("div",{className:"bg-white overflow-hidden shadow rounded-lg",children:(0,a.jsx)("div",{className:"p-5",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("div",{className:"flex-shrink-0",children:(0,a.jsx)("svg",{className:"h-6 w-6 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,a.jsx)("div",{className:"ml-5 w-0 flex-1",children:(0,a.jsxs)("dl",{children:[(0,a.jsx)("dt",{className:"text-sm font-medium text-gray-500 truncate",children:"Gesamtwert"}),(0,a.jsxs)("dd",{className:"text-lg font-medium text-gray-900",children:["€",l.reduce((e,t)=>
1e+t.purchasePrice,0).toLocaleString("de-DE")]})]})})]})})}),(0,a.jsx)("div",{className:"bg-white overflow-hidden shadow rounded-lg",children:(0,a.jsx)("div",{className:"p-5",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("div",{className:"flex-shrink-0",children:(0,a.jsx)("svg",{className:"h-6 w-6 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,a.jsx)("div",{className:"ml-5 w-0 flex-1",children:(0,a.jsxs)("dl",{children:[(0,a.jsx)("dt",{className:"text-sm font-medium text-gray-500 truncate",children:"Zustand \xd8"}),(0,a.jsx)("dd",{className:"text-lg font-medium text-gray-900",children:"4.2 / 5"})]})})]})})}),(0,a.jsx)("div",{className:"bg-white overflow-hidden shadow rounded-lg",children:(0,a.jsx)("div",{className:"p-5",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("div",{className:"flex-shrink-0",children:(0,a.jsx)("svg",{className:"h-6 w-6 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,a.jsx)("div",{className:"ml-5 w-0 flex-1",children:(0,a.jsxs)("dl",{children:[(0,a.jsx)("dt",{className:"text-sm font-medium text-gray-500 truncate",children:"Wartung f\xe4llig"}),(0,a.jsx)("dd",{className:"text-lg font-medium text-gray-900",children:"3"})]})})]})})})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,a.jsx)("h2",{className:"text-lg font-medium text-gray-900 mb-4",children:"Inventar nach Kategorie"}),(0,a.jsx)("div",{className:"space-y-4",children:Object.entries(q).map(e=>{let[t,s]=e,r=l.filter(e=>e.category===t).length,i=l.length>0?r/l.length*100:0;return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-1",children:[(0,a.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-2xl",children:W[t]}),s]}),(0,a.jsx)("span",{className:"text-sm text-gray-600",children:r})]}),(0,a.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,a.jsx)("div",{className:"bg-primary h-2 rounded-full",style:{width:"".concat(i,"%")}})})]},t)})})]}),(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,a.jsx)("h2",{className:"text-lg font-medium text-gray-900 mb-4",children:"Nachhaltigkeits-Score"}),(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-32 h-32 rounded-full bg-green-100 mb-4",children:(0,a.jsx)("div",{className:"text-3xl font-bold text-green-600",children:"85%"})}),(0,a.jsx)("p",{className:"text-gray-600 mb-4",children:"Ihrer M\xf6bel sind wiederverwertbar"}),(0,a.jsxs)("div",{className:"text-left space-y-2",children:[(0,a.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,a.jsx)("span",{children:"CO2-Fu\xdfabdruck gesamt:"}),(0,a.jsx)("span",{className:"font-medium",children:"245.8 kg"})]}),(0,a.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,a.jsx)("span",{children:"Durchschn. Lebensdauer:"}),(0,a.jsx)("span",{className:"font-medium",children:"8.5 Jahre"})]}),(0,a.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,a.jsx)("span",{children:"Wiederverwendbar:"}),(0,a.jsx)("span",{className:"font-medium",children:"92%"})]})]})]})]})]})]}),"list"===t&&(0,a.jsx)("div",{className:"bg-white rounded-lg shadow overflow-hidden",children:(0,a.jsxs)("table",{className:"min-w-full divide-y divide-gray-200",children:[(0,a.jsx)("thead",{className:"bg-gray-50",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"ID / QR"}),(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Artikel"}),(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Standort"}),(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Zustand"}),(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Wert"}),(0,a.jsx)("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Aktionen"})]})}),(0,a.jsx)("tbody",{className:"bg-white divide-y divide-gray-200",children:z.map(t=>(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:t.id}),(0,a.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("span",{className:"text-2xl mr-3",children:W[t.category]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"text-sm font-medium text-gray-900",children:[t.manufacturer," ",t.model]}),(0,a.jsxs)("div",{className:"text-sm text-gray-500",children:["SN: ",t.serialNumber]})]})]})}),(0,a.jsxs)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:[t.location.room,", ",t.location.workstation,t.location.employee&&(0,a.jsx)("div",{className:"text-xs",children:t.location.employee})]}),(0,a.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,a.jsx)("div",{className:"flex items-center",children:[void 0,void 0,void 0,void 0,void 0].map((e,s)=>(0,a.jsx)("svg",{className:"h-4 w-4 ".concat(s<t.condition.rating?"text-yellow-400":"text-gray-300"),fill:"currentColor",viewBox:"0 0 20 20",children:(0,a.jsx)("path",{d:"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"})},s))})}),(0,a.jsxs)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:["€",t.purchasePrice.toLocaleStr
1ing("de-DE")]}),(0,a.jsxs)("td",{className:"px-6 py-4 whitespace-nowrap text-right text-sm font-medium space-x-4",children:[(0,a.jsx)("button",{onClick:()=>{N(t),w(!0)},className:"text-primary hover:text-primary/80",children:"Details"}),(0,a.jsx)("button",{onClick:()=>{let e=J(t),s=window.open("about:blank");s&&s.document.write('<img src="'.concat(e,'" alt="QR" />'))},className:"text-gray-600 hover:text-gray-900",children:"QR"}),(0,a.jsx)("button",{onClick:async()=>{if(e&&"string"==typeof e&&confirm("Wirklich l\xf6schen?"))if((await fetch("/api/inventory/".concat(e,"/items/").concat(t.id),{method:"DELETE"})).ok){let t=await fetch("/api/inventory/".concat(e,"/items"));t.ok&&c((await t.json()).map(x))}else alert("L\xf6schen fehlgeschlagen")},className:"text-red-600 hover:text-red-800",children:"L\xf6schen"})]})]},t.id))})]})}),"add"===t&&(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,a.jsx)("h2",{className:"text-2xl font-bold mb-6",children:"Neues M\xf6belst\xfcck erfassen"}),(0,a.jsxs)("form",{className:"space-y-6",onSubmit:async t=>{t.preventDefault();try{let t=null;if(T.photo){let e=await h(T.photo);t=JSON.stringify([{id:"photo-1",data:e,uploadedAt:new Date().toISOString()}])}let a={name:"".concat(T.manufacturer," ").concat(T.model).trim()||"Unbenannt",category:T.category||"other",manufacturer:T.manufacturer||null,model:T.model||null,serial_number:T.serialNumber||null,location_building:T.building||null,location_floor:T.floor||null,location_room:T.room||null,location_workstation:T.workstation||null,condition_rating:3,photos_json:t};if(!(await fetch("/api/inventory/".concat(e,"/items"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).ok)return void alert("Fehler beim Speichern");F({category:"",manufacturer:"",model:"",serialNumber:"",building:"",floor:"",room:"",workstation:"",photo:null}),s("list");let r=await fetch("/api/inventory/".concat(e,"/items"));r.ok&&c(await r.json()),alert("M\xf6belst\xfcck erfolgreich erfasst!")}catch(e){alert("Fehler beim Speichern")}},children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2",children:[(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("h3",{className:"text-lg font-medium",children:"Grunddaten"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Kategorie *"}),(0,a.jsxs)("select",{className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent",value:T.category,onChange:e=>F({...T,category:e.target.value}),required:!0,children:[(0,a.jsx)("option",{value:"",children:"Bitte w\xe4hlen"}),Object.entries(q).map(e=>{let[t,s]=e;return(0,a.jsxs)("option",{value:t,children:[W[t]," ",s]},t)})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Hersteller *"}),(0,a.jsx)("input",{type:"text",className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent",value:T.manufacturer,onChange:e=>F({...T,manufacturer:e.target.value}),required:!0})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Modell *"}),(0,a.jsx)("input",{type:"text",className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent",value:T.model,onChange:e=>F({...T,model:e.target.value}),required:!0})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Seriennummer"}),(0,a.jsx)("input",{type:"text",className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent",value:T.serialNumber,onChange:e=>F({...T,serialNumber:e.target.value})})]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("h3",{className:"text-lg font-medium",children:"Standort"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Geb\xe4ude"}),(0,a.jsx)("input",{type:"text",className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent",value:T.building,onChange:e=>F({...T,building:e.target.value})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Etage"}),(0,a.jsx)("input",{type:"text",className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent",value:T.floor,onChange:e=>F({...T,floor:e.target.value})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Raum *"}),(0,a.jsx)("input",{type:"text",className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent",value:T.room,onChange:e=>F({...T,room:e.target.value}),required:!0})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Arbeitsplatz"}),(0,a.jsx)("input",{type:"text",className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent",value:T.workstation,onChange:e=>F({...T,workstation:e.target.value})})]})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Foto hochladen"}),(0,a.jsx)("div",{className:"mt-1 flex justify-center px-6 pt-5 pb-6 border-2 border-gray-300 border-dashed rounded-lg",children:(0,a.jsxs)("div",{className:"space-y-1 text-center",children:[(0,a.jsx)("svg",{className:"mx-auto h-12 w-12 text-gray-400",stroke:"currentColor",fill:"none",viewBox:"0 0 48 48",children:(0,a.jsx)("path",{d:"M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28m0 0l4 4m4-24h8m-4-4v8m-12 4h.02",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})}),(0,a.jsxs)("div",{className:"flex text-sm text-gray-600",children:[(0,a.jsxs)("label",{htmlFor:"furniture-upload",className:"relative cursor-pointer bg-white rounded-md font-medium text-primary hover:text-primary/80",children:[(0,a.jsx)("span",{children:"Foto hochladen"}),(0,a.jsx)("input",{id:"furniture-upload",name:"furniture-upload",type:"file",className:"sr-only",accept:"image/*",onChange:e=>{var t;let s=null==(t=e.target.files)?void 0:t[0];s&&F({...T,photo:s})}})]}),(0,a.jsx)("p",{className:"pl-1",children:"oder per Drag & Drop"})]})]})})]}),(0,a.jsxs)("div",{className:"flex gap-4 pt-6",children:[(0,a.jsx)(o.A,{text:"Speichern & QR-Code generieren",variant:"primary",type:"submit"}),(0,a.jsx)(o.A,{text:"Abbrechen",variant:"outline",onClick:()=>s("overview")})]})]})]})]})]}),f&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:(0,a.jsxs)("div",{className:"flex items-center justify-center min-h-screen px-4",children:[(0,a.jsx)("div",{className:"fixed inset-0 bg-black opacity-50",onClick:()=>y(!1)}),(0,a.jsxs)("div",{className:"relative bg-white rounded-lg max-w-4xl w-full p-8",children:[(0,a.jsx)("button",{onClick:()=>y(!1),className:"absolute top-4 right-4 text-gray-400 hover:text-gray-500",children:(0,a.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),(0,a.jsx)("h2",{className:"text-2xl font-bold mb-6",children:"QR-Codes drucken"}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-4 mb-6",children:l.slice(0,9).map(e=>(0,a.jsxs)("div",{className:"border rounded-lg p-4 text-center",children:[(0,a.jsx)(i(),{src:J(e),alt:"QR Code f\xfcr ".concat(e.id),className:"mx-auto mb-2"}),(0,a.jsx)("p",{className:"text-sm font-medium",children:e.id}),(0,a.jsxs)("p",{className:"text-xs text-gray-600",children:[e.manufacturer," ",e.model]})]},e.id))}),(0,a.jsxs)("div",{className:"flex gap-4",children:[(0,a.jsx)(o.A,{text:"Alle drucken",variant:"primary",onClick:()=>{window.print(),y(!1)}}),(0,a.jsx)(o.A,{text:"Schlie\xdfen",variant:"outline",onClick:()=>y(!1)})]})]})]})}),b&&v&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:(0,a.jsxs)("div",{className:"flex items-center justify-center min-h-screen px-4",children:[(0,a.jsx)("div",{className:"fixed inset-0 bg-black opacity-50",onClick:()=>w(!1)}),(0,a.jsxs)("div",{className:"relative bg-white rounded-lg max-w-4xl w-full p-8",children:[(0,a.jsx)("button",{onClick:()=>w(!1),className:"absolute top-4 right-4 text-gray-400 hover:text-gray-500",children:(0,a.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),(0,a.jsx)("h2",{className:"text-2xl font-bold mb-6",children:"M\xf6belst\xfcck Details"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-8",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-semibold mb-4",children:"Grunddaten"}),(0,a.jsxs)("dl",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("dt",{className:"text-gray-600",children:"ID:"}),(0,a.jsx)("dd",{className:"font-medium",children:v.id})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("dt",{className:"text-gray-600",children:"Kategorie:"}),(0,a.jsx)("dd",{className:"font-medium",children:q[v.category]})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("dt",{className:"text-gray-600",children:"Hersteller:"}),(0,a.jsx)("dd",{className:"font-medium",children:v.manufacturer})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("dt",{className:"text-gray-600",children:"Modell:"}),(0,a.jsx)("dd",{className:"font-medium",children:v.model})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("dt",{className:"text-gray-600",children:"Kaufdatum:"}),(0,a.jsx)("dd",{className:"font-medium",children:new Date(v.purchaseDate).toLocaleDateString("de-DE")})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("dt",{className:"text-gray-600",children:"Kaufpreis:"}),(0,a.jsxs)("dd",{className:"font-medium",children:["€",v.purchasePrice.toLocaleStr
1ing("de-DE")]})]})]}),(0,a.jsx)("h3",{className:"font-semibold mb-4 mt-6",children:"Standort"}),(0,a.jsxs)("dl",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("dt",{className:"text-gray-600",children:"Geb\xe4ude:"}),(0,a.jsx)("dd",{className:"font-medium",children:v.location.building})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("dt",{className:"text-gray-600",children:"Etage:"}),(0,a.jsx)("dd",{className:"font-medium",children:v.location.floor})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("dt",{className:"text-gray-600",children:"Raum:"}),(0,a.jsx)("dd",{className:"font-medium",children:v.location.room})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("dt",{className:"text-gray-600",children:"Arbeitsplatz:"}),(0,a.jsx)("dd",{className:"font-medium",children:v.location.workstation})]}),v.location.employee&&(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("dt",{className:"text-gray-600",children:"Mitarbeiter:"}),(0,a.jsx)("dd",{className:"font-medium",children:v.location.employee})]})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"bg-gray-100 rounded-lg p-4 mb-6",children:[(0,a.jsx)(i(),{src:J(v),alt:"QR Code f\xfcr ".concat(v.id),className:"mx-auto"}),(0,a.jsx)("p",{className:"text-center mt-2 text-sm text-gray-600",children:v.qrCode})]}),(0,a.jsx)("h3",{className:"font-semibold mb-4",children:"Zustand & Wartung"}),(0,a.jsxs)("dl",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("dt",{className:"text-gray-600",children:"Bewertung:"}),(0,a.jsx)("dd",{className:"font-medium",children:(0,a.jsx)("div",{className:"flex items-center",children:[void 0,void 0,void 0,void 0,void 0].map((e,t)=>(0,a.jsx)("svg",{className:"h-4 w-4 ".concat(t<v.condition.rating?"text-yellow-400":"text-gray-300"),fill:"currentColor",viewBox:"0 0 20 20",children:(0,a.jsx)("path",{d:"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"})},t))})})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("dt",{className:"text-gray-600",children:"Letzte Inspektion:"}),(0,a.jsx)("dd",{className:"font-medium",children:new Date(v.condition.lastInspection).toLocaleDateString("de-DE")})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("dt",{className:"text-gray-600",children:"Garantie bis:"}),(0,a.jsx)("dd",{className:"font-medium",children:new Date(v.warranty.endDate).toLocaleDateString("de-DE")})]})]}),(0,a.jsx)("h3",{className:"font-semibold mb-4 mt-6",children:"Nachhaltigkeit"}),(0,a.jsxs)("dl",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("dt",{className:"text-gray-600",children:"CO2-Fu\xdfabdruck:"}),(0,a.jsxs)("dd",{className:"font-medium",children:[v.sustainability.co2Footprint," kg"]})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("dt",{className:"text-gray-600",children:"Recycelbar:"}),(0,a.jsx)("dd",{className:"font-medium",children:v.sustainability.recyclable?"Ja":"Nein"})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("dt",{className:"text-gray-600",children:"Wiederverwendbar:"}),(0,a.jsx)("dd",{className:"font-medium",children:v.sustainability.reusable?"Ja":"Nein"})]})]})]})]}),(0,a.jsxs)("div",{className:"mt-8 grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-semibold mb-2",children:"Historie"}),v&&(0,a.jsx)(u,{companyUuid:String(e),itemUuid:v.id}),v&&(0,a.jsx)(p,{companyUuid:String(e),itemUuid:v.id,onSaved:()=>{}})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-semibold mb-2",children:"M\xe4ngel"}),v&&(0,a.jsx)(g,{companyUuid:String(e),itemUuid:v.id}),v&&(0,a.jsx)(j,{companyUuid:String(e),itemUuid:v.id,onSaved:()=>{}})]})]}),(0,a.jsxs)("div",{className:"flex gap-4 mt-8",children:[(0,a.jsx)(o.A,{text:"Bearbeiten",variant:"primary",onClick:()=>{alert("Bearbeitungsmodus wird in K\xfcrze implementiert.")}}),(0,a.jsx)(o.A,{text:"QR-Code drucken",variant:"outline",onClick:()=>{window.print()}}),(0,a.jsx)(o.A,{text:"Schlie\xdfen",variant:"outline",onClick:()=>w(!1)})]})]})]})})]})}},96141:(e,t,s)=>{"use strict";function a(e){return e instanceof Error?e.message:"string"==typeof e?e:e&&"object"==typeof e&&"message"in e?String(e.message):"Unbekannter Fehler"}s.d(t,{u1:()=>a})}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=47772)),_N_E=e.O()}]);

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.