mirror of
https://github.com/docmost/docmost.git
synced 2026-05-22 01:32:55 +08:00
feat: favorites (#2103)
* feat: favorites and templates(ee) * rename migrations * fix sidebar * cleanup tabs * fix * turn off templates * cleanup * uuid validation
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user