specify types for runtime

This commit is contained in:
centauridesigns committed 2024-10-15 17:18:42 +02:00
1 parent 94715d8145
commit e4abae84f7
5 files changed
+5 -10

No files matched your search

+2 -2
View File
@@ -29,10 +29,10 @@ interface EventCardProps {
const recurringEvents: RecurringEvent[] = eventItems.recurring_events;
const specialEvents: SpecialEvent[] = eventItems.special_events;
const places: Place[] = eventItems.places.map((place: any) => ({
const places: Place[] = eventItems.places.map((place: { name: string; closing_times: { day: string; time: string }[] }) => ({
name: place.name,
closingHours: new Map(
place.closing_times.map((time: any) => [time.day, time.time])
place.closing_times.map((time) => [time.day, time.time])
),
}));
+1 -2
View File
@@ -1,8 +1,7 @@
import React, { useEffect, useState } from "react";
import React from "react";
import vipps from "../../public/images/vipps.png";
import Image from 'next/image';
import SanityPeople from "../people";
import SanityEvents from "../events";
const InfoCard: React.FC = () => {
interface Person {
+1 -3
View File
@@ -1,10 +1,9 @@
import exp from "constants";
import React from "react";
import { useEffect } from "react";
function TimeCard() {
const [time, setTime] = React.useState<Date>(new Date());
const [date, setDate] = React.useState<Date>(new Date());
const [date] = React.useState<Date>(new Date());
useEffect(() => {
const interval = setInterval(() => {
@@ -25,7 +24,6 @@ function TimeCard() {
const formatDate = (date: Date) => {
const day = date.getDate().toString().padStart(2, "0");
const ending = findDateEnding(date);
const month = (date.getMonth() + 1).toString().padStart(2, "0");
const monthText = date.toLocaleString("default", { month: "long" });
const year = date.getFullYear();
-2
View File
@@ -1,6 +1,4 @@
"use client";
import next from "next";
import MenuCard from "./components/MenuCard";
import TemperatureCard from "./components/TemperatureCard";
import TimeCard from "./components/TimeCard";
+1 -1
View File
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from "react";
import { useEffect, useState } from "react";
const SanityPeople = () => {
const [people, setPeople] = useState([]);