import { Meta } from '@storybook/react-vite'; import { Chat, SessionMessages, ChatInput, SessionMessagePanel, SessionsList, NewSessionButton, SessionGroups, SessionMessagesHeader, Session, remarkRedact, commonRedactMatchers } from 'reachat'; import { subHours } from 'date-fns'; export default { title: 'Demos/Redact', component: Chat } as Meta; export const RedactExample = () => { const markdownQuestion = `# User Information Please help me with the following sensitive data: - My SSN is 123-45-6789 - Credit card: 4532-1234-5678-9010 - Bitcoin address: 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa Can you help me process this information?`; const markdownResponse = `## Analysis I can see you've provided: - SSN: 123-45-6789 - Credit Card: 4532-1234-5678-9010 - Bitcoin: 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa **Note:** All sensitive information has been automatically redacted in the UI for your security.`; const sessionWithRedaction: Session[] = [ { id: 'session-redact', title: 'Redaction Showcase', createdAt: subHours(new Date(), 1), updatedAt: new Date(), messages: [ { id: 'message-1', role: 'user', content: markdownQuestion, createdAt: new Date() }, { id: 'message-2', role: 'assistant', content: markdownResponse, createdAt: new Date() } ] } ]; return (