Files
gitbook/src/components/DocumentView/BlockContentRef.tsx
T
Sebastian Graz aab7d0bd7a Design pass (#8)
* first stab at bullet points
* setup theming, custom opacities, use of brand UI colors
* color key change
* delete brand
* setup initial defaults
* Add opacity parameter to primary color
* style TOC
* styling pass header, footer, hints, toc, trademark
* table pass
* style pass, typo, quote, tabs, search, theme, toc
2023-11-21 18:29:36 +01:00

46 lines
1.3 KiB
TypeScript

import IconFile from '@geist-ui/icons/file';
import { DocumentBlockContentRef } from '@gitbook/api';
import { resolveContentRef } from '@/lib/references';
import { tcls } from '@/lib/tailwind';
import { BlockProps } from './Block';
export async function BlockContentRef(props: BlockProps<DocumentBlockContentRef>) {
const { block, context, style } = props;
const resolved = await resolveContentRef(block.data.ref, context);
if (!resolved) {
return null;
}
return (
<a
href={resolved.href}
className={tcls(
'flex',
'flex-row',
'items-center',
'rounded',
'border',
'border-dark/2',
'hover:border-dark/4',
'px-5',
'py-2',
'hover:text-dark',
'dark:border-light/2',
'dark:hover:text-light',
'dark:hover:border-light/4',
style,
)}
>
<div className={tcls('mr-5')}>
<IconFile className={tcls('w-6', 'h-6')} />
</div>
<div>
<div className={tcls('text-base')}>{resolved.text}</div>
</div>
</a>
);
}