mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-26 23:51:14 +02:00
refactor(public-chat-snapshots-manager): extract info alert into a constant for improved readability and reuse
This commit is contained in:
parent
9ec89f94de
commit
81e8c353f0
1 changed files with 12 additions and 15 deletions
|
|
@ -17,6 +17,16 @@ interface PublicChatSnapshotsManagerProps {
|
|||
workspaceId: number;
|
||||
}
|
||||
|
||||
const infoAlert = (
|
||||
<Alert>
|
||||
<Info />
|
||||
<AlertDescription>
|
||||
Public chats allow anyone with the URL to view a snapshot of a chat. They do not update when
|
||||
the original chat changes.
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
);
|
||||
|
||||
export function PublicChatSnapshotsManager({
|
||||
workspaceId: _workspaceId,
|
||||
}: PublicChatSnapshotsManagerProps) {
|
||||
|
|
@ -81,14 +91,7 @@ export function PublicChatSnapshotsManager({
|
|||
if (isLoading) {
|
||||
return (
|
||||
<div className="space-y-4 md:space-y-5">
|
||||
<Alert>
|
||||
<Info />
|
||||
<AlertDescription>
|
||||
<div className="flex min-h-[1.625em] items-center">
|
||||
<Skeleton className="h-4 w-60 bg-accent-foreground/15" />
|
||||
</div>
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
{infoAlert}
|
||||
|
||||
{/* Cards grid skeleton */}
|
||||
<div className="grid gap-3 grid-cols-1 sm:grid-cols-2">
|
||||
|
|
@ -135,13 +138,7 @@ export function PublicChatSnapshotsManager({
|
|||
|
||||
return (
|
||||
<div className="space-y-4 md:space-y-5">
|
||||
<Alert>
|
||||
<Info />
|
||||
<AlertDescription>
|
||||
Public chats allow anyone with the URL to view a snapshot of a chat. They do not update
|
||||
when the original chat changes.
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
{infoAlert}
|
||||
|
||||
<PublicChatSnapshotsList
|
||||
snapshots={snapshots}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue