Files
learn-languages/src/app/(features)/srt-player/components/atoms/PlayButton.tsx

20 lines
564 B
TypeScript

"use client";
import React from "react";
import { useTranslations } from "next-intl";
import { LightButton } from "@/design-system/base/button";
import { PlayButtonProps } from "../../types/player";
export function PlayButton({ isPlaying, onToggle, disabled, className }: PlayButtonProps) {
const t = useTranslations("srt_player");
return (
<LightButton
onClick={disabled ? undefined : onToggle}
disabled={disabled}
className={`px-4 py-2 ${className || ''}`}
>
{isPlaying ? t("pause") : t("play")}
</LightButton>
);
}