UNPKG

geoiq-frontend-ui-kit

Version:

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

61 lines (60 loc) 2.38 kB
import e from "react"; import { AccordionDemo as c } from "./index.es2.js"; import { AvatarDemo as d } from "./index.es4.js"; import { Typography as a } from "./index.es17.js"; import { Button as p } from "./index.es7.js"; import { PenLine as g } from "lucide-react"; const N = ({ notes: r, onAddNote: s }) => /* @__PURE__ */ e.createElement( c, { trigger: /* @__PURE__ */ e.createElement(a, { variant: "body1", className: "my-2 text-light-2" }, "Notes"), content: /* @__PURE__ */ e.createElement("div", null, s && /* @__PURE__ */ e.createElement( p, { variant: "secondary", size: "sm", className: "mb-3 flex w-fit justify-start", onClick: s }, /* @__PURE__ */ e.createElement(g, { size: 16, className: "mr-2" }), "Add notes" ), 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, l) => { const m = new Date(t.timestamp), n = m.toLocaleDateString("en-GB"), o = m.toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit" }), i = t.user.first_name?.[0]?.toUpperCase() || ""; return /* @__PURE__ */ e.createElement( "div", { key: l, className: "flex items-start gap-3 border-b border-neutral-2 py-3 last:border-b-0" }, /* @__PURE__ */ e.createElement( d, { imageSrc: t.user.image_url || "", alt: `${t.user.first_name} ${t.user.last_name}`, fallback: i, size: "sm", ...t.user } ), /* @__PURE__ */ e.createElement("div", { className: "mr-3 flex w-full justify-between" }, /* @__PURE__ */ e.createElement( a, { variant: "body4", className: "mt-1 max-w-[250px] whitespace-pre-line break-words text-light-4" }, t.note ), /* @__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" }, o))) ); })), triggerProps: { className: "cursor-pointer my-2" } } ); export { N as NotesSection }; //# sourceMappingURL=index.es136.js.map