import "./components/ui/tidal.css";
import { useState } from "react";
import { TidalChatThread, type TidalChatMessage } from "./components/ui/chat-thread";
import "./components/ui/chat-thread.css";
function tidalExampleAvatarDataUri(seed: unknown) {
const text = String(seed).replace(/[^a-z0-9]/gi, "").slice(-2) || "UI";
const palette = ["#333333", "#555555", "#777777", "#999999", "#bbbbbb"];
const color = palette[Array.from(text).reduce((sum, character) => sum + character.charCodeAt(0), 0) % palette.length];
const svg = ``;
return `data:image/svg+xml,${encodeURIComponent(svg)}`;
}
function tidalExampleImageDataUri(label: string) {
const safeLabel = label.replace(/[<>&]/g, "").slice(0, 28) || "Sample image";
const svg = ``;
return `data:image/svg+xml,${encodeURIComponent(svg)}`;
}
const tidalExampleStyles = ".tidal-scope .chat-thread-demo {\n width: min(100%, 660px);\n min-width: 0;\n}\n.tidal-scope .chat-thread-demo-controls {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n margin-bottom: 14px;\n}\n.tidal-scope .chat-thread-demo-controls > button {\n min-height: 44px;\n padding: 9px 13px;\n background: var(--t-surface);\n color: var(--t-ink);\n border: 1px solid var(--t-border);\n border-radius: 9px;\n font: inherit;\n font-size: 12px;\n}\n.tidal-scope .chat-thread-demo > p {\n margin: 14px 2px 0;\n color: var(--t-muted);\n font-size: 11px;\n line-height: 1.6;\n}";
const initial: TidalChatMessage[] = [
{
id: "one",
author: "Avery",
outgoing: true,
timestamp: "9:41 AM",
avatar: ,
content: "Could you check the new account settings before launch?",
deliveryText: "Read",
},
{
id: "two",
author: "Mila",
timestamp: "9:42 AM",
avatar:
,
content:
"The form looks good. I checked the mobile layout and keyboard controls.",
},
{
id: "three",
author: "Avery",
outgoing: true,
timestamp: "9:43 AM",
avatar:
,
content: "Thanks. I'll add those checks to the release notes.",
deliveryText: "Delivered",
},
];
export function ChatThreadDemo() {
const [messages, setMessages] = useState(initial);
return (
Local sample messages. Nothing is sent.