mirror of
https://github.com/diced/zipline.git
synced 2025-12-12 07:40:45 -08:00
* feat: start removing next.js * feat: working ssr + dev + prod env * feat: all functionality added + client/ -> src/client/ * fix: build process * fix: caching on pnpm action * fix: ignores + cache action * fix: docker + exdev error * fix: generate prisma before types * fix: remove node@20 from actions * feat: dynamic import optimizations + titled pages * fix: removed unused vars * feat: small ui fixes and improvements * feat: small ui improvements * fix: linting error * fix: regex when adding domains
42 lines
976 B
TypeScript
42 lines
976 B
TypeScript
import Markdown from '@/components/render/Markdown';
|
|
import { Response } from '@/lib/api/response';
|
|
import { Container, LoadingOverlay } from '@mantine/core';
|
|
import useSWR from 'swr';
|
|
import GenericError from '../../error/GenericError';
|
|
import { useTitle } from '@/lib/hooks/useTitle';
|
|
|
|
export function Component() {
|
|
useTitle('Terms of Service');
|
|
|
|
const {
|
|
data: config,
|
|
error,
|
|
isLoading,
|
|
} = useSWR<Response['/api/server/public']>('/api/server/public', {
|
|
revalidateOnFocus: false,
|
|
revalidateOnReconnect: false,
|
|
refreshWhenHidden: false,
|
|
revalidateIfStale: false,
|
|
});
|
|
|
|
if (isLoading) return <LoadingOverlay visible />;
|
|
|
|
if (error) {
|
|
return (
|
|
<GenericError
|
|
title='Error loading TOS'
|
|
message='Could not load Terms of Service file...'
|
|
details={error}
|
|
/>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<Container my='lg'>
|
|
<Markdown md={config?.tos || ''} />
|
|
</Container>
|
|
);
|
|
}
|
|
|
|
Component.displayName = 'Tos';
|