main
Some checks failed
UI Deploy (Next-Auth Support) 🎨 / build-and-deploy (push) Failing after 2m42s
Some checks failed
UI Deploy (Next-Auth Support) 🎨 / build-and-deploy (push) Failing after 2m42s
This commit is contained in:
27
src/components/ui/typography/blockquote.tsx
Normal file
27
src/components/ui/typography/blockquote.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import { Blockquote as ChakraBlockquote } from '@chakra-ui/react';
|
||||
import * as React from 'react';
|
||||
|
||||
export interface BlockquoteProps extends ChakraBlockquote.RootProps {
|
||||
cite?: React.ReactNode;
|
||||
citeUrl?: string;
|
||||
icon?: React.ReactNode;
|
||||
showDash?: boolean;
|
||||
}
|
||||
|
||||
export const Blockquote = React.forwardRef<HTMLDivElement, BlockquoteProps>(function Blockquote(props, ref) {
|
||||
const { children, cite, citeUrl, showDash, icon, ...rest } = props;
|
||||
|
||||
return (
|
||||
<ChakraBlockquote.Root ref={ref} {...rest}>
|
||||
{icon}
|
||||
<ChakraBlockquote.Content cite={citeUrl}>{children}</ChakraBlockquote.Content>
|
||||
{cite && (
|
||||
<ChakraBlockquote.Caption>
|
||||
{showDash ? <>—</> : null} <cite>{cite}</cite>
|
||||
</ChakraBlockquote.Caption>
|
||||
)}
|
||||
</ChakraBlockquote.Root>
|
||||
);
|
||||
});
|
||||
|
||||
export const BlockquoteIcon = ChakraBlockquote.Icon;
|
||||
Reference in New Issue
Block a user