import dayjs from "dayjs"; import { motion } from "framer-motion"; import { LayoutTemplate, Plus } from "lucide-react"; import Link from "next/link"; import React from "react"; import { Alert, Badge, Card, Empty, Skeleton } from "../../components"; import { Dashboard } from "../../layouts"; import { useTemplates } from "../../lib/hooks/templates"; /** * */ export default function Index() { const { data: templates } = useTemplates(); return ( <> {templates?.length === 0 && (

Want us to help you get started? We can help you build your first action in less than 5 minutes.

Build an action
)} New } > {templates ? ( templates.length > 0 ? ( <>
{templates .sort((a, b) => { if (a.actions.length > 0 && b.actions.length === 0) { return -1; } if (a.actions.length === 0 && b.actions.length > 0) { return 1; } if (a.subject < b.subject) { return -1; } if (a.subject > b.subject) { return 1; } return 0; }) .map((t) => { return ( <>

{t.subject}

{t.actions.length > 0 && Active}

Last edited {dayjs().to(t.updatedAt)}

Edit
); })}
) : ( <> ) ) : ( )}
); }