mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-26 09:16:22 +02:00
feat: add public chat frontend
This commit is contained in:
parent
9d7259aab9
commit
37adc54d6a
9 changed files with 415 additions and 1 deletions
34
surfsense_web/components/public-chat/public-chat-header.tsx
Normal file
34
surfsense_web/components/public-chat/public-chat-header.tsx
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import { formatDistanceToNow } from "date-fns";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
|
||||
interface PublicChatHeaderProps {
|
||||
title: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export function PublicChatHeader({ title, createdAt }: PublicChatHeaderProps) {
|
||||
const timeAgo = formatDistanceToNow(new Date(createdAt), { addSuffix: true });
|
||||
|
||||
return (
|
||||
<header className="sticky top-0 z-10 -mx-4 mb-4 border-b bg-background/95 px-4 backdrop-blur supports-[backdrop-filter]:bg-background/60">
|
||||
<div className="mx-auto flex max-w-(--thread-max-width) items-center justify-between py-3">
|
||||
<div className="flex items-center gap-3">
|
||||
<Link href="/" className="shrink-0">
|
||||
<Image
|
||||
src="/surfsenselogo.png"
|
||||
alt="SurfSense"
|
||||
width={32}
|
||||
height={32}
|
||||
className="rounded"
|
||||
/>
|
||||
</Link>
|
||||
<div className="min-w-0">
|
||||
<h1 className="truncate font-medium">{title}</h1>
|
||||
<p className="text-xs text-muted-foreground">{timeAgo}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue