mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-09-18 16:05:33 -04:00
simplify theme provider
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import { formatDate } from "../../lib/helpers/format-date";
|
||||
import type { ComponentPropsWithoutRef } from "react";
|
||||
|
||||
export type TimeProps = {
|
||||
export type TimeProps = ComponentPropsWithoutRef<"time"> & {
|
||||
date: string | number | Date;
|
||||
format?: string;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const Time = ({ date, format = "MMM D", className }: TimeProps) => {
|
||||
const Time = ({ date, format = "MMM D", ...rest }: TimeProps) => {
|
||||
return (
|
||||
<time dateTime={formatDate(date)} title={formatDate(date, "MMM D, YYYY, h:mm A z")} className={className}>
|
||||
<time dateTime={formatDate(date)} title={formatDate(date, "MMM D, YYYY, h:mm A z")} {...rest}>
|
||||
{formatDate(date, format)}
|
||||
</time>
|
||||
);
|
||||
|
Reference in New Issue
Block a user