caelum0x d56639a594
Some checks failed
build-images / web (push) Has been cancelled
vision2026-ci / Python SDK resource tests (push) Has been cancelled
build-images / api (push) Has been cancelled
build-images / worker-gpu (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (comfy-workflow-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (effects-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (eventbus-types) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (growth-analytics) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (provider-adapter-kit) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (publishing-connectors) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (render-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (shot-template-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (trends-schema) (push) Has been cancelled
vision2026-ci / Desktop engine crates (test + clippy + fmt) (push) Has been cancelled
codeql / Analyze (javascript-typescript) (push) Has been cancelled
codeql / Analyze (python) (push) Has been cancelled
perf / API hot-path micro-smoke (budgeted) (push) Has been cancelled
perf / Desktop engine crates (release build check) (push) Has been cancelled
vision2026-ci / API phase modules (ruff + pytest) (push) Has been cancelled
vision2026-ci / Alembic upgrade + drift check (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (caption-engine) (push) Has been cancelled
Menivor — open source release (MIT), free to use and fork
Paid, hosted product at menivor.com, now retired as a company project.
Fresh squashed history of the cleaned working tree (secret-scanned,
no .env, no customer data, no outreach logs). Built on
MoneyPrinterTurbo (MIT, harry0703) — see NOTICE.
2026-12-04 02:10:26 +03:00

51 lines
2.2 KiB
TypeScript

"use client";
import { useState } from "react";
import { parseSource } from "@/src/features/create-compose/one-flow/plan";
import { detectLinkKind } from "@/src/features/create-compose/one-flow/link-kind";
interface HeroLinkInputProps {
/** Lifted to the parent (e.g. to also drive the free App Store audit preview). Uncontrolled when omitted. */
readonly value?: string;
readonly onValueChange?: (value: string) => void;
}
/**
* The landing box's field. Works before any JavaScript loads (plain GET
* submit reads the input by `name="q"`); once hydrated it shows one quiet
* line naming what the pasted link is ("TikTok post detected"). Controlled
* when a parent passes `value`/`onValueChange` (so the parent can also show
* the free App Store/Play audit preview for the same pasted link), otherwise
* manages its own state.
*/
export function HeroLinkInput({ value: controlledValue, onValueChange }: HeroLinkInputProps = {}) {
const [internalValue, setInternalValue] = useState("");
const value = controlledValue ?? internalValue;
const parsed = parseSource(value);
const label = parsed?.kind === "link" ? detectLinkKind(parsed.value).label : "";
return (
<div className="flex w-full min-w-0 flex-col gap-1.5 sm:flex-1">
<input
id="hero-create-input"
name="q"
type="text"
required
maxLength={600}
autoComplete="off"
placeholder="Paste an App Store link, any other link, or type a topic"
aria-describedby="hero-create-kind"
value={controlledValue !== undefined ? controlledValue : undefined}
defaultValue={controlledValue === undefined ? "" : undefined}
onChange={(event) => {
setInternalValue(event.target.value);
onValueChange?.(event.target.value);
}}
className="neu-inset h-12 w-full min-w-0 rounded-xl px-4 text-base transition-[border-color,box-shadow] placeholder:text-muted-foreground focus-visible:border-primary/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
/>
<p id="hero-create-kind" aria-live="polite" className="min-h-4 px-1 text-xs text-muted-foreground">
{label}
</p>
</div>
);
}