XeNote/components/ListItem.tsx

23 lines
715 B
TypeScript
Raw Normal View History

2023-12-29 06:03:35 +00:00
import ExternalLinkIcon from "./ExternalLinkIcon";
2023-12-30 16:42:21 +00:00
export interface ListItemProps {
label: string
2023-12-30 16:42:21 +00:00
date?: string
url: string
}
2023-12-30 16:42:21 +00:00
export default function ListItem({ label, date, url }: ListItemProps) {
2023-12-26 01:28:08 +00:00
return (
2023-12-30 16:42:21 +00:00
<div className="hover:bg-white hover:bg-opacity-15 hover:px-3 hover:rounded transition-all duration-200 flex flex-row items-baseline justify-between gap-2">
2023-12-28 02:34:50 +00:00
<p className="text-sm ">{label}</p>
2023-12-26 01:28:08 +00:00
<div className="border border-dashed flex-1 border-gray-500 h-0"></div>
<div className="flex gap-1 items-baseline">
2023-12-30 16:42:21 +00:00
{!!date && <i className="text-xs">{date}</i>}
2023-12-29 06:03:35 +00:00
<a href={url} target="_blank">
<ExternalLinkIcon />
2023-12-26 01:28:08 +00:00
</a>
</div>
</div>
)
}