import{n as e}from"./createLucideIcon-x_DqbPgA.js";import{n as t}from"./chunk-UVKPFVEO-CKgCEGmW.js";import{t as n}from"./book-open-sKRokCqo.js";import{t as r}from"./star-C8GVgyU0.js";import{t as i}from"./sticky-note-CtEl5XUr.js";import{n as a}from"./utils-BHgrqvTr.js";import{l as o}from"./use-notes-BA4IjZRc.js";var s=e();function c(e){return new DOMParser().parseFromString(e,`text/html`).body.textContent||``}function l({note:e,variant:l=`grid`}){let u=o(),d=t=>{t.preventDefault(),t.stopPropagation(),u.mutate({id:e.id,is_favorite:!e.is_favorite})},f=e.content?c(e.content).slice(0,200):``;return l===`compact`?(0,s.jsxs)(t,{to:`/notes/${e.id}`,className:`flex items-center gap-3 p-3 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors`,children:[(0,s.jsx)(i,{className:`w-4 h-4 text-amber-500 shrink-0`}),(0,s.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,s.jsx)(`p`,{className:`text-sm font-medium text-gray-900 dark:text-gray-100 truncate`,children:e.title||`Untitled Note`}),(0,s.jsx)(`p`,{className:`text-xs text-gray-500 dark:text-gray-400`,children:a(e.created_at)})]}),e.reading_status===`reading_list`&&(0,s.jsx)(n,{className:`w-3.5 h-3.5 text-sky-500 shrink-0`})]}):(0,s.jsxs)(t,{to:`/notes/${e.id}`,className:`group block rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800/50 hover:border-sky-300 dark:hover:border-sky-600 hover:shadow-md transition-all overflow-hidden`,children:[(0,s.jsxs)(`div`,{className:`p-4`,children:[(0,s.jsxs)(`div`,{className:`flex items-start justify-between gap-2 mb-2`,children:[(0,s.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,s.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 text-[10px] font-medium rounded-full bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400`,children:[(0,s.jsx)(i,{className:`w-3 h-3`}),`Note`]}),e.reading_status===`reading_list`&&(0,s.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 text-[10px] font-medium rounded-full bg-sky-50 dark:bg-sky-900/20 text-sky-600 dark:text-sky-400`,children:[(0,s.jsx)(n,{className:`w-3 h-3`}),`Reading List`]})]}),(0,s.jsx)(`button`,{onClick:d,className:`shrink-0 p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors`,children:(0,s.jsx)(r,{className:`w-4 h-4 ${e.is_favorite?`fill-yellow-400 text-yellow-400`:`text-gray-300 dark:text-gray-600`}`})})]}),(0,s.jsx)(`h3`,{className:`text-sm font-semibold text-gray-900 dark:text-gray-100 line-clamp-2 mb-1`,children:e.title||`Untitled Note`}),e.summary&&(0,s.jsx)(`p`,{className:`text-xs text-sky-600 dark:text-sky-400 line-clamp-2 mb-2`,children:e.summary}),f&&(0,s.jsx)(`p`,{className:`text-xs text-gray-500 dark:text-gray-400 line-clamp-3`,children:f})]}),(0,s.jsx)(`div`,{className:`px-4 py-2.5 border-t border-gray-100 dark:border-gray-700/50 bg-gray-50/50 dark:bg-gray-800/30`,children:(0,s.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,s.jsx)(`span`,{className:`text-[10px] text-gray-400 dark:text-gray-500`,children:a(e.created_at)})})})]})}export{l as t};