use linkify to automatically convert links to href (#15)

This commit is contained in:
Doh
2025-01-03 21:38:36 -05:00
committed by GitHub
parent 140bb9b3e9
commit a4af30bd23
9 changed files with 78 additions and 226 deletions

View File

@@ -11,6 +11,7 @@ import { d2s, getNow } from '@/lib/utils'
import { useAtom } from 'jotai'
import { settingsAtom } from '@/lib/atoms'
import { DateTime } from 'luxon'
import Linkify from './linkify'
export default function HabitCalendar() {
const [settings] = useAtom(settingsAtom)
@@ -73,7 +74,9 @@ export default function HabitCalendar() {
const isCompleted = getHabitsForDate(selectedDate.toJSDate()).some(h => h.id === habit.id)
return (
<li key={habit.id} className="flex items-center justify-between">
<span>{habit.name}</span>
<span>
<Linkify>{habit.name}</Linkify>
</span>
{isCompleted ? (
<Badge variant="default">Completed</Badge>
) : (