"use client";
import * as React from "react";
import Component, { type Props, type State } from "@/components/ui/delivery-progress";
const settings = { title: "Good things are on their way." };
export const loopDuration = 6;
const smooth = (x: number) => {
const n = Math.max(0, Math.min(1, x));
return n * n * (3 - 2 * n);
};
export function showcase(time: number): State {
const t = ((time % loopDuration) + loopDuration) % loopDuration;
const active = t < 1.4 ? 2 : t < 3.1 ? 3 : t < 4.6 ? 1 : 2;
return { active, expanded: active };
}
export default function Demo(props: any = {}) {
const { showcaseTime, ...incoming } = props;
const merged = { ...settings, ...incoming };
return (
<Component
{...merged}
state={showcaseTime === undefined ? incoming.state : showcase(showcaseTime)}
seeking={showcaseTime !== undefined || incoming.seeking}
/>
);
}