20 lines
360 B
TypeScript
20 lines
360 B
TypeScript
"use client";
|
|
import React from 'react';
|
|
|
|
export default function SyncButton() {
|
|
const handleSync = async () => {
|
|
const res = await fetch('/api/sync');
|
|
const json = await res.json();
|
|
alert(json.message);
|
|
};
|
|
|
|
return (
|
|
<button
|
|
onClick={handleSync}
|
|
className="mb-4 px-4 py-2 border rounded"
|
|
>
|
|
Sync
|
|
</button>
|
|
);
|
|
}
|