// SitterMypage — シッター(受託側)のマイページ。
// 飼い主側 my-bookings.jsx の対になる位置づけ。
// タブ:ホーム / 依頼受付 / スケジュール / 顧客 / 報酬
const TODAY_VISITS = [
{ id:'V-9001', time:'09:30–11:00', owner:'佐藤ご家族', pet:'ココ(柴犬・3歳)',
address:'港区南青山3-◯-◯', service:'訪問ケア・散歩', status:'next', distance:'1.2km' },
{ id:'V-9002', time:'14:00–15:30', owner:'田中ご家族', pet:'ミーシャ(ラグドール・5歳)',
address:'港区赤坂6-◯-◯', service:'訪問ケア', status:'upcoming', distance:'2.4km' },
{ id:'V-9003', time:'18:00–19:00', owner:'伊藤ご家族', pet:'モカ(ミニチュアダックス・8歳)',
address:'渋谷区広尾2-◯-◯', service:'訪問ケア・投薬', status:'upcoming', distance:'3.1km' },
];
const PENDING_REQUESTS = [
{ id:'R-2401', owner:'山口さん', pet:'ハル(トイプードル・1歳)',
when:'5/26(月)10:00–12:00', service:'訪問ケア・散歩', station:'表参道',
note:'初対面でも人懐っこい子です。30分散歩できる方を探しています。',
rate:3200, total:6400, deadlineHours:18 },
{ id:'R-2402', owner:'鈴木さん', pet:'ノア(雑種・2歳)',
when:'5/28(水)09:00–11:30', service:'訪問ケア・投薬', station:'外苑前',
note:'1日2回の点眼が必要です。経験があると安心です。',
rate:3200, total:8000, deadlineHours:42 },
{ id:'R-2403', owner:'高橋さん', pet:'ベル(柴犬・10歳)',
when:'6/1(日)13:00–16:00', service:'訪問ケア・散歩', station:'青山一丁目',
note:'シニア犬なのでゆっくり目で。お薬は不要です。',
rate:3200, total:9600, deadlineHours:96 },
];
const CLIENTS = [
{ name:'佐藤ご家族', species:'dog', photo:'peach', pet:'ココ(柴犬・3歳)', visits:8, lastVisit:'2026-05-19', rating:5.0, station:'表参道' },
{ name:'田中ご家族', species:'cat', photo:'warm', pet:'ミーシャ(ラグドール・5歳)', visits:4, lastVisit:'2026-05-12', rating:4.8, station:'赤坂' },
{ name:'伊藤ご家族', species:'dog', photo:'cream', pet:'モカ(ミニチュアダックス・8歳)', visits:12, lastVisit:'2026-05-18', rating:5.0, station:'広尾' },
{ name:'渡辺ご家族', species:'rabbit', photo:'sage', pet:'クー(ホーランドロップ・4歳)', visits:2, lastVisit:'2026-04-20', rating:4.5, station:'恵比寿' },
];
const PAYOUTS = [
{ month:'2026-05', visits:14, gross:84600, fee:12690, net:71910, status:'進行中' },
{ month:'2026-04', visits:18, gross:108000, fee:16200, net:91800, status:'振込済' },
{ month:'2026-03', visits:16, gross:96000, fee:14400, net:81600, status:'振込済' },
];
function SitterMypage({ initialTab = 'home' }) {
const [tab, setTab] = React.useState(initialTab); // home | requests | schedule | clients | earnings
return (
{/* Header */}
{/* Sub-nav tabs */}
{[
['home','ホーム'],
['requests','依頼受付', PENDING_REQUESTS.length],
['schedule','スケジュール'],
['clients','顧客一覧'],
['earnings','報酬・支払い'],
].map(([k,n,badge])=>(
))}
{tab === 'home' && }
{tab === 'requests' && }
{tab === 'schedule' && }
{tab === 'clients' && }
{tab === 'earnings' && }
);
}
// ---------- ホーム ----------
function SitterHome() {
return (
地図でルートを見る}/>
5/20(水)・3件の訪問予定 ・ 移動距離 約6.7km
{TODAY_VISITS.map(v => )}
すべて見る →}/>
{PENDING_REQUESTS.length}件の依頼が承認待ちです。24時間以内の返答をお願いします。
{PENDING_REQUESTS.slice(0,2).map(r => )}
);
}
// ---------- 依頼受付 ----------
function SitterRequests() {
return (
新着の依頼
{PENDING_REQUESTS.length}件 ・ 24時間以内に承諾/辞退をお願いします
{[['all','すべて'],['urgent','緊急(24h以内)']].map(([k,n],i)=>(
))}
{PENDING_REQUESTS.map(r => )}
);
}
// ---------- スケジュール ----------
function SitterSchedule() {
const days = ['日','月','火','水','木','金','土'];
const today = 3; // 0=Sun ... 6=Sat; 水曜日とする
const weeks = [
[null,null,null, 20, 21, 22, 23],
[24, 25, 26, 27, 28, 29, 30],
[31, '6/1', '6/2', '6/3', '6/4', '6/5', '6/6'],
];
const bookedDays = new Set([20, 22, 24, 26, 27, 28, '6/1', '6/3']);
const fullDays = new Set([21, 25, '6/2']);
return (
← 5月 ・ 6月 →}/>
{days.map((d,i)=>(
{d}
))}
{weeks.map((week,wi)=>(
{week.map((d,di)=>{
if (d == null) return
;
const isToday = d === today + 17;
const isBooked = bookedDays.has(d);
const isFull = fullDays.has(d);
return (
{d}
{isBooked && (
予定
)}
{isFull && (
満員
)}
);
})}
))}
予定あり
満員/休み
受付可
登録時の設定が反映されます。変更したい場合は「プロフィール編集」から。
{['月','火','水','木','金','土','日'].map((d,i)=>(
{d}
))}
受付時間:08:00 〜 20:00
対応エリア:港区南青山 / 半径5km
{TODAY_VISITS.map(v=>(
{v.time}
{v.owner} ・ {v.pet}
))}
);
}
// ---------- 顧客一覧 ----------
function SitterClients() {
return (
{CLIENTS.map((c,i)=>(
{c.name}
=10?'#E8F5E0':'var(--c-primary-soft)',
color:c.visits>=10?'#3a7a2a':'var(--c-primary-deep)',
fontWeight:700,
}}>{c.visits>=10?'リピーター':'継続顧客'}
{c.pet}
{c.station} ・ 累計{c.visits}回 ・ 最終 {c.lastVisit}
{c.rating.toFixed(1)}
頂いた評価
))}
);
}
// ---------- 報酬・支払い ----------
function SitterEarnings() {
const ytd = PAYOUTS.reduce((s,p)=>s+p.net,0);
return (
月訪問件数売上手数料(15%)振込額状態
{PAYOUTS.map(p=>(
{p.month}
{p.visits}件
¥{p.gross.toLocaleString()}
−¥{p.fee.toLocaleString()}
¥{p.net.toLocaleString()}
{p.status}
))}
今期累計(手数料控除後)
¥{ytd.toLocaleString()}
振込履歴をダウンロード}/>
2026-06-10(火)に振込予定
5月分の確定額 ・ 三菱UFJ銀行 ●●●●1234
¥71,910
三菱UFJ銀行
銀座支店 普通 ●●●●1234>}/>
月間20件以上で 手数料が13% に下がります。
);
}
// ---------- 共通パーツ ----------
function SmCard({ children, style }) {
return (
{children}
);
}
function SCardHead({ label, right }) {
return (
);
}
function SStat({n,l,hint}) {
return (
);
}
function VisitRow({ visit }) {
const v = visit;
return (
{v.time.split('–')[0]}
{v.time.split('–')[1]}
{v.status === 'next' && (
次の訪問
)}
{v.owner}
・ {v.pet}
{v.service}
{v.address} ・ {v.distance}
{v.status === 'next' ? (
) : (
)}
);
}
function RequestRow({ req, compact }) {
const r = req;
const urgent = r.deadlineHours <= 24;
return (
{urgent ? `あと${r.deadlineHours}時間` : `${Math.floor(r.deadlineHours/24)}日以内`}
{r.id}
{r.station}駅
{r.owner} ・ {r.pet}
{r.when} ・ {r.service}
{!compact && (
“{r.note}”
)}
{!compact && (
想定報酬
¥{r.total.toLocaleString()}
手数料込み
)}
);
}
function Notice({ icon, title, body }) {
return (
);
}
function Toggle({ label, on }) {
return (
{label}
);
}
function Row({ k, v }) {
return (
{k}
{v}
);
}
window.SitterMypage = SitterMypage;