refactor: move to a typed-tracks system and add support for text

This commit is contained in:
Maze Winther
2025-07-06 20:45:29 +02:00
parent 0e32c732dd
commit 40c7fbb4f8
20 changed files with 1799 additions and 1469 deletions

View File

@ -4,7 +4,6 @@ import { motion } from "motion/react";
import { Button } from "../ui/button";
import { Input } from "../ui/input";
import { ArrowRight } from "lucide-react";
import Link from "next/link";
import { useState } from "react";
import { useToast } from "@/hooks/use-toast";
@ -42,7 +41,7 @@ export function Hero({ signupCount }: HeroProps) {
body: JSON.stringify({ email: email.trim() }),
});
const data = await response.json();
const data = (await response.json()) as { error: string };
if (response.ok) {
toast({
@ -53,7 +52,9 @@ export function Hero({ signupCount }: HeroProps) {
} else {
toast({
title: "Oops!",
description: data.error || "Something went wrong. Please try again.",
description:
(data as { error: string }).error ||
"Something went wrong. Please try again.",
variant: "destructive",
});
}