mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 08:46:22 +02:00
refactor: remove unused comment-related state and components; streamline comment panel styling for improved responsiveness
This commit is contained in:
parent
831ea5d34c
commit
5ecf4e3e9d
11 changed files with 78 additions and 212 deletions
|
|
@ -40,13 +40,15 @@ export function CommentPanel({
|
|||
};
|
||||
|
||||
const isMobile = variant === "mobile";
|
||||
const isInline = variant === "inline";
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"flex min-h-[120px] items-center justify-center p-4",
|
||||
!isMobile && "w-96 rounded-lg border bg-card"
|
||||
isInline && "w-full rounded-xl border bg-card shadow-lg",
|
||||
!isMobile && !isInline && "w-96 rounded-lg border bg-card"
|
||||
)}
|
||||
>
|
||||
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
||||
|
|
@ -65,8 +67,13 @@ export function CommentPanel({
|
|||
|
||||
return (
|
||||
<div
|
||||
className={cn("flex flex-col", isMobile ? "w-full" : "w-85 rounded-lg border bg-card")}
|
||||
style={!isMobile && effectiveMaxHeight ? { maxHeight: effectiveMaxHeight } : undefined}
|
||||
className={cn(
|
||||
"flex flex-col",
|
||||
isMobile && "w-full",
|
||||
isInline && "w-full rounded-xl border bg-card shadow-lg max-h-80",
|
||||
!isMobile && !isInline && "w-85 rounded-lg border bg-card"
|
||||
)}
|
||||
style={!isMobile && !isInline && effectiveMaxHeight ? { maxHeight: effectiveMaxHeight } : undefined}
|
||||
>
|
||||
{hasThreads && (
|
||||
<div className={cn("min-h-0 flex-1 overflow-y-auto scrollbar-thin", isMobile && "pb-24")}>
|
||||
|
|
|
|||
|
|
@ -12,6 +12,6 @@ export interface CommentPanelProps {
|
|||
onDeleteComment: (commentId: number) => void;
|
||||
isSubmitting?: boolean;
|
||||
maxHeight?: number;
|
||||
/** Variant for responsive styling - desktop shows border/bg, mobile is plain */
|
||||
variant?: "desktop" | "mobile";
|
||||
/** Variant for responsive styling - desktop shows border/bg, mobile is plain, inline fits within message width */
|
||||
variant?: "desktop" | "mobile" | "inline";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue