import type { Metadata } from "next";
import Link from "next/link";
import { InnerPage, StructuredData } from "@/components/SiteChrome";
import { breadcrumbJsonLd } from "@/lib/site";

export const metadata: Metadata = {
  title: "How to Download TikTok Videos",
  description: "Copy a public TikTok link on Android, iPhone, or a computer, then save the file Clipwell actually retrieves.",
  alternates: { canonical: "/how-to-download-tiktok-videos" },
  openGraph: {
    title: "How to Download TikTok Videos",
    description: "A practical guide for saving a public TikTok video, photo post, or audio file.",
    url: "/how-to-download-tiktok-videos",
  },
};

export default function HowToPage() {
  return (
    <main id="main">
      <StructuredData
        data={breadcrumbJsonLd([
          { name: "Home", path: "/" },
          { name: "How to Download TikTok Videos", path: "/how-to-download-tiktok-videos" },
        ])}
      />
      <InnerPage
        title="How to download TikTok videos"
        lede="Use the public link from TikTok. Clipwell can only offer files that the public post actually returns."
      >
        <h2>On Android</h2>
        <ol>
          <li>Open TikTok and play the video you want to keep.</li>
          <li>Tap Share, then Copy link.</li>
          <li>Open Clipwell, paste the link, and press Download.</li>
          <li>Choose a file from the list. Your browser saves it to the Downloads folder unless you pick another place.</li>
        </ol>
        <h2>On iPhone and iPad</h2>
        <ol>
          <li>Open the video in TikTok and tap Share, then Copy link.</li>
          <li>Paste the link into Clipwell in Safari or another browser.</li>
          <li>Press Download and choose the file that appears.</li>
          <li>If the video does not land in Photos, open the share sheet on the downloaded file and choose Save Video, or look in the Files app.</li>
        </ol>
        <h2>On a computer</h2>
        <ol>
          <li>Open the video in a browser.</li>
          <li>Copy the address if it contains /video/ or /photo/, or use Share and Copy link.</li>
          <li>Paste it on the <Link href="/#downloader">TikTok Video Downloader</Link> and press Download.</li>
          <li>Click the file you want. The browser handles the save.</li>
        </ol>
        <h2>When a link fails</h2>
        <ul>
          <li>Check that the link is a public video or photo post, not a profile.</li>
          <li>Private, deleted, and age-restricted posts are not retrieved.</li>
          <li>If the page says the downloader is not configured, the operator has turned lookup off. A file will not be invented in that case.</li>
          <li>Expired file buttons need a fresh request. Paste the original TikTok link again.</li>
        </ul>
        <p>
          Read the <Link href="/#copy-link">copy-link notes</Link> or the <Link href="/#faq">FAQ</Link> if you want the short version.
        </p>
      </InnerPage>
    </main>
  );
}
