mirror of
https://github.com/docmost/docmost.git
synced 2026-05-17 23:14:07 +08:00
d42091ccb1
* feat: favorites and templates(ee) * rename migrations * fix sidebar * cleanup tabs * fix * turn off templates * cleanup * uuid validation
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
import { Group, Text } from "@mantine/core";
|
|
import { CustomAvatar } from "@/components/ui/custom-avatar";
|
|
import { useTranslation } from "react-i18next";
|
|
import { useTimeAgo } from "@/hooks/use-time-ago";
|
|
import { ITemplate } from "@/ee/template/types/template.types";
|
|
|
|
type TemplateMetaProps = {
|
|
template: ITemplate;
|
|
};
|
|
|
|
export default function TemplateMeta({ template }: TemplateMetaProps) {
|
|
const { t } = useTranslation();
|
|
const updatedAtAgo = useTimeAgo(template.updatedAt);
|
|
|
|
return (
|
|
<Group gap={8} mt="xs" wrap="nowrap" style={{ cursor: "default" }}>
|
|
{template.creator?.name && (
|
|
<>
|
|
<CustomAvatar
|
|
size={24}
|
|
radius="xl"
|
|
name={template.creator.name}
|
|
avatarUrl={template.creator.avatarUrl}
|
|
/>
|
|
<Text size="sm" c="dimmed" fw={500}>
|
|
{t("By {{name}}", { name: template.creator.name })}
|
|
</Text>
|
|
</>
|
|
)}
|
|
{updatedAtAgo && (
|
|
<Text size="sm" c="dimmed">
|
|
{t("Updated {{time}}", { time: updatedAtAgo })}
|
|
</Text>
|
|
)}
|
|
</Group>
|
|
);
|
|
}
|