Re-added the url property
This commit is contained in:
@@ -1,19 +1,24 @@
|
|||||||
import { Title } from "../Primitives/Title";
|
import { Title } from "../Primitives/Title";
|
||||||
|
|
||||||
export type PreviewBoxProps = {
|
export type PreviewBoxProps = {
|
||||||
|
link?: string;
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
className?: string;
|
className?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function PreviewBox({ children, className }: PreviewBoxProps) {
|
export function PreviewBox({ link, className, children }: PreviewBoxProps) {
|
||||||
return (
|
return (
|
||||||
<div className={className}>
|
<div className={className}>
|
||||||
<Title className="text-slate-700 transition dark:text-slate-400 mb-2">
|
<Title className="text-slate-700 transition dark:text-slate-400 mb-2">
|
||||||
Preview
|
Preview
|
||||||
</Title>
|
</Title>
|
||||||
<div className="block rounded-sm p-2 text-slate-700 bg-slate-100 transition dark:text-slate-300 dark:bg-white dark:bg-opacity-5 hover:bg-slate-200 hover:cursor-pointer">
|
<a
|
||||||
<div className="relative">{children}</div>
|
className="block rounded-sm p-2 text-slate-700 bg-slate-100 transition dark:text-slate-300 dark:bg-white dark:bg-opacity-5 hover:bg-slate-200 hover:cursor-pointer"
|
||||||
</div>
|
href={link}
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
<div>{children}</div>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user