Some checks are pending
E2E / Playwright e2e (push) Waiting to run
- Introduced turbopack alias for canvas in next.config.mjs. - Updated package.json scripts for development and branding tasks. - Added new dependencies for Tiptap extensions. - Implemented new demo layouts for agenda, contacts, drive, and mail applications. - Enhanced globals.css for improved theming and splash screen animations. - Added OAuth callback handling for drive mounts. - Updated layout components to integrate new demo shells and improve structure.
51 lines
1.0 KiB
TypeScript
51 lines
1.0 KiB
TypeScript
"use client"
|
|
|
|
import { useEffect, useState } from "react"
|
|
import { formatDriveListDate } from "@/lib/drive/drive-date"
|
|
import { cn } from "@/lib/utils"
|
|
|
|
export function DriveListModified({
|
|
iso,
|
|
className,
|
|
}: {
|
|
iso: string
|
|
className?: string
|
|
}) {
|
|
const [formatted, setFormatted] = useState<{
|
|
short: string
|
|
full: string
|
|
dateTime?: string
|
|
} | null>(null)
|
|
|
|
useEffect(() => {
|
|
if (!iso?.trim()) {
|
|
setFormatted({ short: "—", full: "" })
|
|
return
|
|
}
|
|
setFormatted(formatDriveListDate(iso))
|
|
}, [iso])
|
|
|
|
if (!formatted?.full) {
|
|
return (
|
|
<span
|
|
className={cn("text-sm text-muted-foreground", className)}
|
|
suppressHydrationWarning
|
|
>
|
|
{formatted?.short ?? "\u00a0"}
|
|
</span>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<time
|
|
dateTime={formatted.dateTime}
|
|
title={formatted.full}
|
|
aria-label={formatted.full}
|
|
className={cn("text-sm text-muted-foreground", className)}
|
|
suppressHydrationWarning
|
|
>
|
|
{formatted.short}
|
|
</time>
|
|
)
|
|
}
|