20 lines
629 B
TypeScript
20 lines
629 B
TypeScript
import type { Widget } from "@/lib/config/schema";
|
|||
|
|
|
||
|
|
type BookmarkWidget = Extract<Widget, { type: "bookmark" }>;
|
||
|
|
|
||
|
|
export function BookmarkWidget({ widget }: { widget: BookmarkWidget }) {
|
||
|
|
return (
|
||
|
|
<a
|
||
|
|
href={widget.href}
|
||
|
|
target="_blank"
|
||
|
|
rel="noreferrer"
|
||
|
|
className="flex flex-col gap-1 rounded-[var(--radius-widget)] border border-border bg-surface p-4 transition-colors hover:border-accent"
|
||
|
|
>
|
||
|
|
<span className="text-sm font-medium text-fg">{widget.name}</span>
|
||
|
|
{widget.description && (
|
||
|
|
<span className="text-xs text-fg-muted">{widget.description}</span>
|
||
|
|
)}
|
||
|
|
</a>
|
||
|
|
);
|
||
|
|
}
|