import {
ActionIcon,
Anchor,
Box,
Button,
Card,
Container,
Group,
Paper,
SimpleGrid,
Stack,
Text,
TextInput,
ThemeIcon,
Title,
} from '@mantine/core';
import {
IconBook2,
IconHelpCircle,
IconLifebuoy,
IconMail,
IconMessageQuestion,
IconSearch,
IconShieldQuestion,
IconX,
} from '@tabler/icons-react';
import { useMemo, useState } from 'react';
import knownIssues from '../../known-issues.json';
import { SEO } from '../components/SEO/SEO';
import { SiteFooter } from '../components/SiteFooter/SiteFooter';
import { SiteHeader } from '../components/SiteHeader/SiteHeader';
import classes from './SupportPage.module.css';
export function SupportPage() {
const [query, setQuery] = useState('');
const normalizedQuery = query.trim().toLowerCase();
const suggestions = useMemo(() => {
if (!normalizedQuery) {
return [];
}
const terms = normalizedQuery
.split(/\s+/)
.map((term) => term.replace(/[^a-z0-9-]/g, ''))
.filter((term) => term.length > 2);
return knownIssues
.map((issue) => {
const searchable = [issue.title, issue.summary, issue.solution, ...issue.keywords]
.join(' ')
.toLowerCase();
const score = terms.filter((term) => searchable.includes(term)).length;
return { issue, score };
})
.filter(({ score }) => score > 0)
.sort((left, right) => right.score - left.score)
.slice(0, 5);
}, [normalizedQuery]);
return (
<>
How can we help?
Search account access, messaging, media, privacy, and security help.
setQuery(event.currentTarget.value)}
leftSection={}
rightSection={
query ? (
setQuery('')}
aria-label="Clear support search"
>
) : null
}
placeholder="Describe your problem"
aria-label="Search Rosetta support"
size="lg"
radius="sm"
className={classes.searchInput}
/>
{normalizedQuery && (
{suggestions.length > 0 ? (
{suggestions.map(({ issue }) => (
setQuery('')}
className={classes.suggestion}
>
{issue.title}
{issue.summary}
))}
) : (
No matching known issue
Try fewer words or contact the support team below.
)}
)}
Known issues
Common situations and the information needed to resolve them.
{knownIssues.map((issue) => (
{issue.title}
{issue.summary}
{issue.solution}
))}
Still need help?
Include your operating system, Rosetta version, approximate time,
and reproduction steps. Never send a recovery phrase or private key.
}
variant="default"
>
support@rosetta.im
>
);
}