UNPKG

geoiq-frontend-ui-kit

Version:

This project is a UI kit for GeoIQ's frontend. It's built with React, TypeScript, and Vite.

68 lines (67 loc) 3.04 kB
import e from "react"; import { AccordionDemo as c } from "./index.es4.js"; import { Typography as a } from "./index.es19.js"; import { Button as p } from "./index.es9.js"; import { FileText as d } from "lucide-react"; import { Spinner as g } from "./index.es60.js"; import { AvatarDemo as f } from "./index.es6.js"; import "clsx"; import "tailwind-merge"; import "./index.es56.js"; import "./index.es86.js"; import "./index.es29.js"; import "./index.es35.js"; const D = ({ notes: r, onAddNote: l, notesLoading: o }) => /* @__PURE__ */ e.createElement( c, { trigger: /* @__PURE__ */ e.createElement(a, { variant: "body1", className: "my-2 text-light-2" }, "Call history & notes"), content: /* @__PURE__ */ e.createElement("div", null, l && /* @__PURE__ */ e.createElement("div", { className: "w-full sticky top-0 bg-light-1 z-50 pb-2" }, /* @__PURE__ */ e.createElement( p, { variant: "secondary", size: "sm", className: "flex w-fit justify-start", onClick: l }, /* @__PURE__ */ e.createElement(d, { size: 16, className: "mr-1" }), "Add notes" )), o && /* @__PURE__ */ e.createElement("div", { className: "flex justify-center items-center py-2" }, /* @__PURE__ */ e.createElement(g, null)), r.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "py-4 text-start text-light-4" }, "Nothing here yet. Add a note to begin.") : r.map((t, m) => { const i = new Date(t.timestamp), n = i.toLocaleDateString("en-GB"), s = i.toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit" }); return /* @__PURE__ */ e.createElement( "div", { key: m, className: `flex items-start gap-3 py-3 ${m !== r.length - 1 ? "border-b border-neutral-2" : ""}` }, /* @__PURE__ */ e.createElement( f, { imageSrc: t.user.image_url || "", alt: t.user.first_name, fallback: t.user.first_name?.[0]?.toUpperCase() || "", size: "md" } ), /* @__PURE__ */ e.createElement("div", { className: "mr-3 flex w-full justify-between" }, /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement( a, { variant: "body2", className: "mt-1 max-w-[250px] whitespace-pre-line break-words text-light-3" }, t.note ), t.call_duration && /* @__PURE__ */ e.createElement(a, { variant: "body6", className: "text-light-4 mt-1" }, t.call_duration)), /* @__PURE__ */ e.createElement("div", { className: "flex flex-col gap-1" }, /* @__PURE__ */ e.createElement(a, { variant: "body6", className: "text-light-2" }, n), /* @__PURE__ */ e.createElement(a, { variant: "body6", className: "text-light-4" }, s))) ); })), triggerProps: { className: "cursor-pointer my-2" }, contentProps: { className: "max-h-[400px] overflow-y-auto" } } ); export { D as NotesSection }; //# sourceMappingURL=index.es124.js.map